# CSS Optimization: Is Using Declarations Just Once Still Effective?

Evaluating the relevance of the 18-year-old UDJO technique in modern web development.

- **Source:** [CSS-Tricks](https://brifing.si/source/eea3b580-b2ba-4369-b9e0-7fc8ad2ad5e3)
- **Published:** 2026-11-10
- **Topic:** [technology](https://brifing.si/c/technology)
- **Original article:** <https://css-tricks.com/css-using-declarations-just-once/>
- **On Brifing:** https://brifing.si/s/6802c89e-9c52-419d-8bad-973c88c2c33a

## The UDJO Technique Explained

Using Declarations Just Once, or UDJO, is an 18-year-old optimization technique inspired by the DRY principle. It works by grouping selectors that share identical CSS declarations into a single rule. This approach aims to reduce code repetition, potentially improving both the maintainability of stylesheets and the overall file size of web assets.

## Factors Influencing Optimization Success

The effectiveness of UDJO depends heavily on two primary factors: the intelligence of the deduplication process and the length of the selectors involved. Intelligent grouping ensures that maintainability is preserved, while shorter selector lengths dictate the actual file size savings. Balancing these two variables is essential for achieving meaningful performance gains in production.

## Automating Complex Style Deduplication

Manually deduplicating declarations in complex, modern websites is often impractical and time-consuming. To address this, specialized tooling like CSS Dedup was created to identify and safely consolidate repetitive rules. These tools automate the process, ensuring that changes to the cascade remain safe while identifying opportunities for reducing total stylesheet transfer sizes.

## Empirical Analysis of Modern Sites

An analysis of 20 websites using CSS Dedup demonstrated that UDJO remains a viable optimization strategy today. By focusing on both provably and probably safe deduplication, the study showed that file size reductions are achievable. These results suggest that developers can still extract performance benefits from their existing CSS by applying these automated methods.

## Performance and Maintainability Trade-offs

While UDJO can improve performance, it is not a replacement for standard compression methods like Gzip or Brotli. Instead, it serves as a low-cost optimization vector that complements existing workflows. Developers must weigh the potential file size savings against the impact on long-term stylesheet maintainability when deciding to implement these automated deduplication strategies.

## Static Site Optimization Potential

Recent testing indicates that UDJO is particularly effective for static sites. By running tools like CSS Dedup on already minified stylesheets, developers can achieve further size reductions at almost no additional cost. This approach demonstrates that even highly optimized codebases often contain hidden redundancies that can be safely removed for better performance.

## The Future of CSS Optimization

The belief that all CSS optimization potential has been exhausted is likely premature given the language's daily evolution. As web development practices shift, new techniques and tools continue to emerge. UDJO represents a niche but valuable part of an overall performance strategy that developers should explore to push the boundaries of current web efficiency.

## Recommendations for Web Professionals

Developers interested in performance should review and test UDJO within their own projects. While the technique requires careful configuration to avoid breaking the cascade, the potential for reduced transfer sizes is clear. Moving forward, integrating such deduplication steps into build pipelines could become a standard practice for maintaining lean, high-performance frontend codebases.

## Sources covering this story

- https://css-tricks.com/css-using-declarations-just-once/ — 

---

_Summary written by Brifing from the original reporting. Copyright in the original article belongs to its publisher; read the full piece at the link above._
