Design Systems · 5 min read
Case Is Not a New Word
CSS can now decide state on its own. Put states in tokens and let the stylesheet inflect one glyph, instead of drawing a new icon each time.
For years, a change of state meant a new file. A selected tab got a second icon. A warning got a third. A syncing document got a fourth, drawn by whoever was on the team that week. The stylesheet could recolor a glyph, but it could not decide anything. Logic lived in JavaScript, and every state that JavaScript did not reach became another drawing. That is changing. CSS is learning to make decisions, and that moves state out of the icon folder and into the system that styles it.
What changed in CSS
Three features matter here.
The first is `if()`. It lets one property choose its value from a condition. MDN describes three kinds of test: `style()` checks a custom property on the element, `media()` checks a media condition such as screen width, and `supports()` checks whether the browser supports a feature. The first condition that is true wins. A custom property is a named value you set yourself, such as `--state: error`.
The second is `@function`. It lets you define a reusable function in plain CSS, with arguments and a result. MDN notes that custom functions already have browser support, while the related mixins (`@mixin` and `@apply`) are not supported anywhere yet. The spec behind them, CSS Functions and Mixins, is still a draft. Chrome's July 2026 roundup of new web UI features lists both `if()` and `@function`.
The third is container style queries. A style query applies styles based on the custom properties of a parent element. It is one of the six main focus areas of Interop 2026, the yearly project in which the browser makers agree to fix the same features together. It was announced in February.
Together, these let a component read one value, its state, and set everything that follows from it: stroke, fill, badge, color and motion.
State is case, not vocabulary
In Sanskrit grammar, case (vibhakti) changes a word's role in a sentence without making a new word. The noun stays the noun. Its ending tells you whether it acts, receives or belongs.
Interface state works the same way. A document icon that is selected, disabled, syncing or in error is still a document. What changed is its role in this moment. When a team draws a new glyph for each state, it invents a new word for every grammatical case. The vocabulary grows, the meanings blur, and nobody can say which of four document icons is the real one.
The new CSS lets the stylesheet hold the case. Write the state once, as a custom property, and let `if()` resolve what it means:
```css .icon { --state: default; color: var(--icon-default); color: if( style(--state: error): var(--icon-error); style(--state: disabled): var(--icon-disabled); else: var(--icon-default); ); } ```
The first `color` line is the fallback. MDN is direct about this: `if()` does not degrade gracefully, so a browser without it needs a plain declaration first.
The case for drawing the variant
The strongest counterpoint is practical. `if()` is not Baseline, the label for features that work in all the major browsers. MDN marks it experimental, with limited availability. A drawn variant works everywhere today. And some states really do change shape: a filled star and an outline star are different marks, not just different colors.
Both points are fair. Neither defeats the position.
On support: write the state as a token now, and let each browser resolve it as far as it can. A token is a named design decision stored as data, such as `icon.error`. A browser without `if()` reads the fallback, or a class set from the same token. Either way, the meaning lives in one place. When support arrives, you delete code instead of drawing more.
On shape: a change of form is still a modifier on the same root, not a new root. Filled versus outline can be a second axis, set by the same state value. The grammar decides which states change form and which only change color. The stylesheet carries out that decision. What you avoid is the fourth document icon, drawn without a rule.
What this means for a design system
Move state out of the asset folder and into tokens. Name the states your product really uses. Many products can start with five: default, selected, disabled, error and in progress. Give each one a token, and let every component read a single property.
This is also where Severity (tivrata) earns its place as a separate modifier root. Severity is not part of the noun. It is a level applied to the noun. The frame carries the mood; the symbol carries the noun. A warning frame around a document says something about the document's condition, and that frame can be set from the same token that sets its color.
Last, review the full set in one place. A state you can preview by changing one property is a state you can review. A state hidden in a separate SVG file is a state nobody checks until it ships.
Icon lens
Digital Sanskrit treats a glyph as a word and its states as inflection. The roots stay few. Compounds join roots into new meanings, and case changes a word's role without changing its identity. CSS can finally carry case on its own. That gives the grammar a home in code: the manifest names the root, the token names the case, and the stylesheet applies it. The drawing is made once.
Try this
**Goal:** Replace drawn state variants with one state token per component.
**Steps:** 1. List every icon in your library that exists only as a state variant of another icon. 2. Group them by root glyph, and name the state each variant shows. 3. Pick five states and define a token for each. 4. Rewrite one component so it reads a single `--state` property, with a plain fallback declaration first. 5. Delete the variant files the component no longer needs.
**Check:** Changing one property moves the component through all five states, and no state needs its own SVG unless the grammar says its form changes.
**Reference:** Appendix A.6, Case (vibhakti); Appendix B.2, Continuity.
Sources
- [if() - CSS | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/if)
- [CSS custom functions and mixins | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Custom_functions_and_mixins)
- [What's new in web UI (I/O 2026) | Chrome for Developers](https://developer.chrome.com/blog/new-in-web-ui-io26?hl=en)
- [Interop 2026: Continuing to improve the web for developers | web.dev](https://web.dev/blog/interop-2026)