Menu

Two invisible bytes wiped 130 CSS colour tokens on 462 pages, and every check passed
📰

Two invisible bytes wiped 130 CSS colour tokens on 462 pages, and every check passed

DEV Community: css·Katia Belokon·21 days ago
#m2shShOH
#devtocss#devto#dev#file#exit
Reading 0:00
15s threshold

TL;DR

My stylesheet started with two UTF-8 byte order marks instead of one. The decoding algorithm browsers use strips only the first, so the second became part of the first selector, and the :root rule holding 130 colour tokens stopped matching on 462 pages.

All checks and the deploy passed. Only a live measurement of the rendered page caught it: background #ffffff where it should have been #f5f0e8 .

Check for a BOM after byte 0 in CI, and assert computed styles on the live page, not just files.

The background that came back white

I built MyIPScan , a set of free network-privacy checks served as a static site. The first rule in its stylesheet is a :root block with 130 colour tokens as CSS custom properties.

After a deploy, a live measurement of the page background came back #ffffff . It should have been #f5f0e8 , a warm off-white.

Nothing else flagged it.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.