Chapter 2. The Problems of CSS at Scale
In the last chapter, we talked about the scenario which gave rise to the ECSS methodology. A large, CSS codebase that developers found difficult to reason about, cumbersome to work with and was littered with poorly commented and redundant code. However, no CSS codebase starts this way.
In most projects, the CSS starts out with some simple rules. At the outset, you'd have to be doing something fairly daft to make maintenance of the CSS problematic.
However, as the project grows, so too does the CSS. Requirements become more complicated. More authors get involved writing the styles. Edge cases and browser workarounds need to be authored and factored in. It's easy for things to get unruly fast.
Let's consider the growing demands on a humble widget:
- When the widget is in the sidebar, can we reduce the font size?
- When we're on the home page, can the widget have a different background colour?
- Can we have the things inside the widget...