Friday Letter — CSS

Move a madrasah's Friday letter to phones, a laptop and paper: float, columns, BEM, counters, print. 16 levels, right in the browser.

What you learn in this game

At the end of Menteng Lane stands MI Miftahul Ulum. Every Friday Ms. Ulfah in the school office types the Surat Jumat, photocopies it and folds it into the children’s bags. This semester the letter moves to the madrasah’s website: parents read it on their phones, and a paper copy is still printed for the grandparents. Each chip fills one hole in surat.css. A real browser builds the letter on a phone, a laptop or a printed sheet, then Check reads out the browser’s own measurements: boxes, lines and how many characters they hold, computed values, and the numbers it actually drew. Every line of the checklist names its number and its source.

Multi-column layout splits one flow of text into several columns side by side, like a newspaper. The browser cuts the text itself: the first column fills to the bottom, then the text carries on at the top of the second. From this Friday the checklist also counts the characters on every line, from the box of every character the browser draws.

The more teachers write in the Surat Jumat, the more easily their class names collide. A CSS methodology is a naming rule everyone agrees on, so one part’s CSS does not change another part. BEM (Block Element Modifier) writes block__element--modifier. The checklist reads the values the browser actually computed for each heading.

A CSS counter is a count the browser keeps: it counts the elements you point it at and draws the number in front of each one. Inserting or moving an item means no numbers to retype. The checklist reads the number actually drawn: the page is painted twice, once as your CSS draws it and once with the number it should have, then the two are compared pixel by pixel.

@media print wraps rules that apply only when the page is printed. The checklist prints the letter on A4 the way a browser emulates print: @media print blocks switched on and @media screen blocks switched off, then the sheet is measured like any other screen.