Layered color
utilities layer beats components here.
If you searched css @layer or reduce specificity, layers let you order theme, components, and utilities without !important wars. :where() keeps selectors at zero specificity.
Later layers win over earlier regardless of order in file.
utilities layer beats components here.
@layer theme, components, utilities;
@layer components { .btn { background: blue; } }
@layer utilities { .btn { background: green; } }Override without fighting ID selectors.
.lay-active wins with a simple class.
:where(ul li) { color: #64748b; }
ul li.lay-active { color: #4f46e5; font-weight: 700; }Layers reduce need for !important in large codebases.
Prefer layers + low-specificity tokens over !important chains.
Document layer order in design systems.
@layer overrides {
.danger { color: crimson; }
}