Built a 637‑line print stylesheet
Built a 637‑line print stylesheet against four documented
rendering‑engine behaviours, including run‑in headings that printed
white on white for any reader whose browser preferred dark.
August 2026

Situation. The site's case studies are the artefact somebody prints
and takes into a meeting. That makes paper a real output rather than
a courtesy, and paper is a different medium from a narrow screen —
the reader's paper size is unknown, the reader's orientation is
unknown, and the browser's print behaviour differs between engines
in ways no screen preview reveals.

Task. The site had to print correctly on unknown paper, in both
colour themes, without a separate document being maintained beside
the web one.

Action. It is one 637‑line stylesheet with a single page rule and
one print block. The page rule sets a margin and deliberately sets
no paper size, so whatever the reader chooses in the dialog comes
through and everything else adapts to it. The root font size is
pinned in points so every relative measurement has a physical
anchor, and one measure of about seventy‑two characters is applied
to the four top‑level blocks — which is the sheet winning over the
design, since a landscape page would otherwise run a line to about a
hundred and ten characters. Four engine behaviours are documented as
traps, each having caused a real defect. Viewport units resolve to
the page box in one engine and to the window in another, so a page
printed from a wide window has a third of every line cropped off in
the second. Fixed‑position elements paint on every sheet, so the
decorative ones are dropped and two of them are repurposed as a
letterhead and a colophon. The palette defaults to white text
because the default theme is dark, which printed the four section
run‑in labels white on white — the words were simply absent. And
paged media cannot split a flex or grid box, which produced a blank
first sheet on an achievement page. A six‑part check covers it,
testing six paper and orientation combinations, both colour‑scheme
preferences, and the real page count against what the content height
implies.

Result. The site prints on unknown paper in both themes, and the
four engine behaviours are written down with the defect each
produced. The known limits are recorded rather than hidden: no page
numbers or running heads, one engine ignores widow and orphan
control, and drop caps are not universal. A stray comment terminator
once made the CSS linter swallow a whole rule and pass clean twice —
only the print check noticed.

Categories:
1Frontend Engineering	/categories/frontend/	engineer.company	70
1Web Development	/categories/web-development/	engineer.company	70
1Design Systems & UI	/categories/design-systems/	engineer.company	70
1UX / UI Design	/categories/ux-ui/	engineer.company	70
1Documentation	/categories/documentation/	engineer.company	70

Services:
1Frontend Development	/services/frontend-development/	engineer.company	70
1Website Development & CMS	/services/web-development/	engineer.company	70
1UI/UX Design & Design Systems	/services/ui-ux-design/	engineer.company	70

hThis page on the web	URL:https://engineer.company/portfolio/built-a-637-line-print-stylesheet/	engineer.company	70
