UDJO — "using declarations just once" — has been around for at least 18 years, yet whether it still earns a place in a CSS workflow is worth asking directly. The technique follows the DRY principle by finding repeated declarations and collapsing them into a single rule. Where display: flex appears in two separate places, the rules are merged so the declaration is written once:
.example {
display: flex;
}
.sample {
display: flex;
}
becomes:
.example,
.sample {
display: flex;
}
Two variables decide how much the outcome is worth: how intelligently the deduplication is done, and how long the selectors are. Intelligence determines whether the result is a genuine maintainability win — can a changed declaration really be applied to every selector now attached to it? Selector length decides how much the file shrinks.
Deduplicating with tooling
On a large or long-lived site whose declarations were never tidied up, hand-deduplicating is heavy work. To cut that down, CSS Dedup was built to both identify repetition and resolve what can be safely optimized. Only safe deduplication is applied, because moving selectors changes their position and therefore affects how the cascade works.
Two deduplication modes were compared: declarations that are provably safe to merge, and declarations that are probably safe, kept only where merging also shrinks the file. The second reflects the "natural" result of deduplication alongside the version site owners would most likely want, since UDJO can serve maintainability and performance at the same time.
Measurements across two samples
The first batch was an arbitrary set of 20 websites. Removing provably safe repetition worked in every one of them; in 18 of the 20, it also increased file size, because the selectors that get joined together are longer than the declarations saved.
| Site | UDJO Effect (External Style Sheets) (-f) | Aggressive With Savings Only (-f -a -s) |
|---|---|---|
| 12371.cn | +2.9 KB (+14.3%) | -45 B (-0.2%) |
| ccc.de | +0.8 KB (+2.2%) | -0.1 KB (-0.3%) |
| commission.europa.eu | +64.9 KB (+6.4%) | -51.9 KB (-5.1%) |
| die-linke.de | +104.0 KB (+20.5%) | -21.2 KB (-4.2%) |
| diem25.org | +40.5 KB (+10.7%) | -4.4 KB (-1.2%) |
| eff.org | +120.8 KB (+27.7%) | -8.5 KB (-2.0%) |
| en.mfa.ir | +58.7 KB (+5.1%) | -51.2 KB (-4.5%) |
| euroveg.eu | +78.8 KB (+9.3%) | -12.4 KB (-1.5%) |
| globalsumudflotilla.org | -17.0 KB (-6.5%) | -18.7 KB (-7.2%) |
| gruene.de | +1.6 KB (+1.1%) | -0.7 KB (-0.5%) |
| icanw.org | +5.5 KB (+2.9%) | -3.5 KB (-1.8%) |
| laquadrature.net | +14.0 KB (+4.2%) | -3.0 KB (-0.9%) |
| middleeasteye.net | +60.9 KB (+8.6%) | -20.5 KB (-2.9%) |
| movimientosumar.es | +98.8 KB (+13.6%) | -5.0 KB (-0.7%) |
| nam.go.ug | +84.5 KB (+9.2%) | -53.9 KB (-5.9%) |
| oic-oci.org | -6.3 KB (-4.0%) | -9.3 KB (-6.0%) |
| podemos.info | +23.2 KB (+5.5%) | -6.0 KB (-1.4%) |
| taxmenow.eu | +1.7 KB (+2.1%) | -4.0 KB (-4.6%) |
| unrwa.org | +87.4 KB (+13.2%) | -4.8 KB (-0.7%) |
| veganeurope.eu | +37.3 KB (+17.7%) | -1.3 KB (-0.6%) |
That trade-off can be steered. When only the deduplication that produces actual savings is applied, declaration repetition can be cut in all 20 cases and the file still gets smaller.
A second sample of sites from the web development field shows much the same pattern, though at a different ratio: on every site there is repetition safe to remove, and in 5 cases (50%, against 90% in the first sample) doing so grows the file size. In all cases, repetition can again be reduced in a way that saves bytes.
| Site | UDJO Effect (External Style Sheets) (-f) | Aggressive With Savings Only (-f -a -s) |
|---|---|---|
| bram.us | +19.6 KB (+7.3%) | -4.2 KB (-1.6%) |
| ishadeed.com | +4.2 KB (+11.4%) | -0.2 KB (-0.5%) |
| joshwcomeau.com | -2.7 KB (-3.8%) | -5.0 KB (-7.2%) |
| kevinpowell.co | +0.1 KB (+0.6%) | -0.1 KB (-0.5%) |
| kizu.dev | +1.0 KB (+1.7%) | -0.1 KB (-0.2%) |
| lea.verou.me | -0.4 KB (-1.4%) | -0.6 KB (-2.3%) |
| miriamsuzanne.com | -0.2 KB (-0.5%) | -0.7 KB (-2.0%) |
| paul.kinlan.me | +3.3 KB (+8.0%) | -1.0 KB (-2.4%) |
| pawelgrzybek.com | -0.5 KB (-2.7%) | -0.7 KB (-4.3%) |
| sarasoueidan.com | -2.9 KB (-7.3%) | -4.5 KB (-11.1%) |
The comparisons rest on selector length and on whether a given merge truly improves maintainability, so they say nothing about overall CSS quality. Compression was not measured; minifying and checking gzip or Brotli output would be a fair follow-up test.
Reading the results
UDJO's effectiveness always comes back to the kind of repetition involved and the length of the selectors. Tools such as CSS Dedup treat every declaration use case the same way, which makes them blunt; configuration is what lets you keep only the merges that pay off. Because the savings reported here are produced by safe changes, deduplication behaves as a low-cost performance lever — most useful when applied to minified output, and best checked alongside gzip or Brotli.
The samples also hint at a habit worth examining: developers who write shorter selectors may gain more from UDJO, since duplicated selectors are what erode the savings. More samples would be needed to say whether that holds generally. What the data does show is that deduplication, long a niche technique, can shrink CSS while reducing repetition — and it is tooling, not a ceiling on optimization, that has been missing.



