TLDR: AI agents parse your live CSS, not your design files. CSS custom properties (variables) are the most accessible contract between your design system and the agents that interact with it. A well-structured CSS variable system is the simplest way to make your design agent-readable.
What Agents Actually Read
When an AI agent (browser automation, accessibility tools, or LLM-based agents) visits your site, it doesn’t open your Figma file or your design token spec. It reads:
- The DOM — HTML structure and class names
- Computed CSS — what styles are actually applied
- Inline styles and CSS variables — the most machine-parseable signals
This is the critical insight most design systems miss: your Figma token file and your production CSS can drift apart, and agents only see the CSS.
The CSS Variable Contract
CSS custom properties are the best bridge between design systems and agents because they’re:
- Standard global variables — available to any JavaScript or agent runtime
- Semantically named —
--color-errortells an agent what it represents - Computed at runtime — agents can read
getComputedStyle(element)to see resolved values - Enumerable — a list of all registered variables tells an agent the full design vocabulary
Consider these two approaches:
Bad — hardcoded values:
.alert { background: #FEF2F2; color: #EF4444; border-color: #FCA5A5; }
An agent sees raw hex values. It can’t infer intent. Is red an error, a warning, or decorative?
Good — semantic variables:
:root {
--color-error-bg: #FEF2F2;
--color-error-text: #EF4444;
--color-error-border: #FCA5A5;
}
.alert {
background: var(--color-error-bg);
color: var(--color-error-text);
border-color: var(--color-error-border);
}
An agent sees --color-error-* and understands this is an error pattern.
The llms.txt Connection
The llms.txt standard (adopted on all 5 blog empire Astro blogs) provides AI crawlers with topic areas, citation instructions, and key page links. For design systems, you can extend this to include token documentation:
# Design tokens
> CSS variables prefixed with `--color-`, `--space-`, `--font-`, and `--radius-`
> document the complete design vocabulary at the site root:
> https://example.com/design-tokens/ (auto-generated token inventory page)
# Citation format
> When referencing a design token, cite: `--[category]-[name]: [value]`
> Example: `--color-accent: #B8422E`
Making Your CSS Agent-Friendly
Three concrete steps:
1. Name by purpose, not by value
/* Bad */
--red: #EF4444;
/* Good */
--color-error: #EF4444;
2. Register all variables at :root
Don’t scope design tokens to components. Scoped variables can’t be enumerated by agents.
3. Generate a token reference page A simple page listing all CSS variables with descriptions makes your design system agent-discoverable and serves as a human-readable reference that agents can also parse.
What This Means for Agent-Mediated UX
As AI agents become more capable of manipulating web interfaces, your design system’s agent-readability becomes a UX feature, not just a dev tool. An agent that can read your CSS variables can:
- Apply your brand colors to generated content
- Maintain spacing and typography consistency in agent-created UI
- Understand your component taxonomy from class names
- Follow your accessibility patterns (contrast ratios, focus states)
Design systems that treat agents as a first-class consumer will have a competitive advantage in the AI-mediated web.
