Cascade layers
css/domestic.css declares the order once, before anything else
(@layer on MDN,
CSS Cascade 5):
@layer reset, tokens, base, layout, components, utilities;
Later layers win over earlier ones regardless of selector specificity, and your own
unlayered CSS beats all of them, so overriding never needs !important or specificity tricks.
| Layer | Contents |
|---|---|
reset | A modest reset: box-sizing, zero margins, block media, inherited form fonts |
tokens | Primitive and semantic custom properties |
base | Native elements: typography, lists, tables, forms, buttons, dialog, details, focus |
layout | .stack, .cluster, .grid, [data-scroll] and the page layouts (list-detail, split, dashboard, action bar, app shell) |
components | Atoms in css/components/atoms/ (M2), molecules in css/components/molecules/ (M3a) and organisms in css/components/organisms/ (M3b). See the atoms index, the molecules index and the organisms index |
utilities | Single-purpose helpers such as .visually-hidden; last so they always apply |
Our choice: this order, because each layer only refines the ones before it, and a utility should beat a component the way an inline override would.