Declaration, inheritance and scope
The basics matter because custom properties are part of the cascade, not a separate system.
A custom property is declared with a name like `--space-md` and consumed with `var(--space-md)`. Because it participates in the cascade, it can inherit and be redefined by context.
Not everything belongs in `:root`. Put global tokens there, but keep component-only variables close to the component when that improves clarity.
- Global: `:root { --space-md: 1rem; }`
- Component: `.card { --card-padding: 1rem; }`
- Context: `[data-density="compact"] { --space-md: .75rem; }`