Why Mixing UI State with Design Tokens Breaks CSS Architecture Contracts
A CSS design system called quell-base.css uses a dedicated 'ghost_tokens' layer to pre-resolve baseline design values — such as colors and spacing — before paint, acting as a safeguard against flash of unstyled content. The layer's documented token vocabulary covers properties like font, color, space, and shadow, but explicitly excludes application-state variables. When a state flag like --is-modal-open is placed inside this layer, the browser raises no objection, since CSS custom properties are syntactically uniform regardless of intent. The problem is semantic: the layer was built to hold stable baseline values, not dynamic application state, so storing a modal-visibility flag there forces the page to assert an application condition before the app itself has established it. This conflation undermines the layer's documented contract and misuses the override mechanisms designed for theme customization, not state management.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in