Testing 18-Year-Old CSS Trick UDJO: Does Declaration Deduplication Still Pay Off?
UDJO, an 18-year-old CSS deduplication technique, cut repetition on all 30 sites tested — but naive use grew files on 23 of them. Configuration is everything.
- AuthorPriya Raman
- ChannelDesign Tools
- Filed
- Read3 min

- UDJO, a CSS technique at least 18 years old, reduced declaration repetition on all 30 sites tested.
- Naive deduplication increased file size on 18 of 20 organizational sites; eff.org grew 120.8 KB (+27.7%).
- Savings-only mode shrank files on every site tested, e.g. sarasoueidan.com by -11.1%.
- Only 50% of developer sites grew under naive UDJO versus 90% of organizational sites.
- Measurements exclude post-compression effects such as gzip and Brotli.
Deduplicating repeated CSS declarations reduced repetition on all 30 sites tested — yet on 23 of them, it made the stylesheet larger, according to a new experiment run with a purpose-built tool called CSS Dedup.
The technique under test is UDJO, "using declarations just once," which is at least 18 years old. It applies the DRY principle to stylesheets: when a declaration like display: flex appears in two rules, UDJO merges them into one grouped selector —
.example,
.sample {
display: flex;
}
The author, who tested the technique against modern production sites, frames the central question plainly: is UDJO still effective and still relevant today, for a language that evolves almost daily?
The honest answer required tooling. Complex sites with never-deduplicated stylesheets make manual reconciliation impractical, so the author built CSS Dedup to identify repetition and safely deduplicate it. The tool works by changing selector locations — which is itself part of how the cascade works, hence the "provably safe" and "probably safe" distinctions in its output.
What did the first 20-site sample show?
The first batch covered 20 arbitrarily chosen websites, analyzed in two modes:
- Natural UDJO (
-f): deduplicate everything provably safe in external stylesheets. - Aggressive with savings only (
-f -a -s): deduplicate probably-safe cases, but only when the result shrinks the file.
The numbers cut both ways. EFF.org's stylesheets grew by 120.8 KB (+27.7%) under natural UDJO, but shrank by 8.5 KB (-2.0%) in savings-only mode. die-linke.de ballooned by 104.0 KB (+20.5%), yet saved 21.2 KB when configured to demand savings. Two sites — globalsumudflotilla.org (-17.0 KB, -6.5%) and oic-oci.org (-6.3 KB, -4.0%) — got smaller even under natural dedup. The European Commission's site swung from +64.9 KB to -51.9 KB between the two modes.
Three findings emerged:
- All 20 sites contained declaration repetition that could safely be removed.
- In 18 of 20 cases, naive deduplication increased file size, because grouped selectors repeat and often run longer than the declarations they replace.
- In every case, deduplication could be tuned to also reduce transfer size.
One caveat the author insists on, and it matters: these figures say nothing about CSS quality. They depend on selector length, and they don't verify whether deduplication actually improves maintainability in each case. Post-compression effects — gzip, Brotli — were left out entirely, though the author concedes that would be fair to test.
Do web professionals write cleaner CSS?
A second sample examined 10 developer portfolios and blogs, from bram.us to sarasoueidan.com. The pattern held, with one twist:
- Every site still had safe-to-remove repetition.
- Only 5 of 10 (50%, versus 90% for organizations) saw file growth from naive dedup.
- All 10 could be deduplicated into net savings.
Sara Soueidan's site shrank by 2.9 KB (-7.3%) naturally and 4.5 KB (-11.1%) aggressively — the best result in the batch. Josh Comeau's site shed 2.7 KB under plain UDJO. At the other end, bram.us grew 19.6 KB (+7.3%) before configuration brought it to -4.2 KB.
The author's hypothesis, offered tentatively: web professionals may use shorter selectors, which lets them benefit more from UDJO. More samples would be needed to confirm it.
Is UDJO still effective?
Yes — with conditions. CSS Dedup is blunt by design; it doesn't distinguish between declaration use cases. Configured to only deduplicate when savings result, it delivers them in most cases, based on safe changes alone. That makes it a low-cost performance optimization vector, especially applied to minified output.
The author still couches the promise: stack it against real-world compression like gzip or Brotli before celebrating. And since the technique has stayed niche and the tooling is new, the invitation is to review, test, and explore. As the author puts it, it seems hard to argue that we have reached the ceiling of how far we can take CSS optimization.
Original: meiert.com
More from Priya Raman
Show full bio
Market editor covering technology and product news in Product and interaction design, design systems at Interface Wire.
68 articles