Dabish Digital
Development

When CSS architecture is worth the effort

There is no clever trick in this one, just a handful of decisions worth making deliberately. CSS architecture is not free, and pretending otherwise leads to bad decisions.

The question is rarely whether something can be built, but what it costs to keep running afterwards. The teams that stay on top of it are the ones who put it on a calendar rather than a wish list.

When it is worth it

Naming conventions prevent the specificity arms race. There is a version of this that is over-engineered, and it is worth avoiding. Write the reasoning down alongside the decision, because the reasoning is what changes first.

When it is not

If nothing downstream depends on it and nobody is complaining, it can wait. Where this goes wrong is almost never a lack of knowledge.

How to decide

Deleting CSS should be as easy as adding it. There is a version of this that is over-engineered, and it is worth avoiding. Doing this properly once is usually cheaper than doing it approximately three times.

In practice

Most development decisions are really maintenance decisions wearing a different hat. Three things worth confirming about CSS architecture before you move on:

  • Someone can say what the current setup is without going to look
  • Deleting CSS should be as easy as adding it — and you know whether that is true here
  • There is a way to tell whether the last change to this helped

Pick the one that would hurt most if it failed, and start there.