Caffeinated Coder
Book an appointment
Lesson 17 · Motion and scale

Organising CSS at scale

On a big site, many rules from many people end up styling the same element, and the winner is decided by specificity, which nobody planned. Follow one heading through a real conflict: an id rule beats the component's class rule. Then fix it with three tools: BEM names that keep selectors to one class, a design token kept in a custom property, and cascade layers that let a later layer win before specificity is even compared. Last, change one token and watch the component follow.

12 min9 steps5 questionsAdvanced
Fig 17 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.