theme-system-design — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited theme-system-design (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
A theme system is a contract between design decisions and component code, structured as named tokens arranged in tiers so that appearance can change without touching the components that render it. Its core mechanism is indirection: components consume intent-named tokens (a "surface" color, a "primary text" color), and a theme supplies the mapping from those intent names to concrete values. The mainstream model uses three tiers — reference tokens (raw values like blue.500 = #1E66F5), system or semantic tokens (intent-named like color.background.surface), and component tokens (component-specific overrides like button.primary.background) — with components allowed to read only the system and component tiers. On the web the runtime delivery vehicle is CSS custom properties scoped to a selector (:root for the default, [data-theme="dark"] for alternates), which cascade and inherit so that overriding a subtree's theme is a single attribute change. Runtime switching adds three operational concerns — persisting the choice, applying it before first paint to avoid a flash, and propagating it to components that read theme imperatively. What the system buys is that three different rates of change (rarely-changing brand values, occasionally-changing theme assignments, continuously-changing components) each get their own surface to evolve on, so a theme swap repaints the whole product, a new theme is just a new set of system-token values, and a removed token fails loudly at build time instead of silently at runtime.
A theme system is a contract between design decisions and component code, expressed as named tokens that components consume and themes resolve. The mainstream model uses three tiers — reference tokens (raw values: blue.500 = #1E66F5), system or semantic tokens (intent-named: color.background.surface, color.text.primary), and component tokens (component-specific overrides: button.primary.background). Components consume system and component tokens only; themes provide reference-token-to-system-token mappings. This indirection is what allows a single theme swap to repaint the whole product without component edits.
CSS custom properties are the dominant runtime delivery mechanism for web themes. A theme is a set of custom-property assignments scoped to a selector — typically :root for the default, [data-theme="dark"] for alternates. Custom properties cascade and inherit, so a theme override on a subtree (a dark-on-light landing-page hero inside a light app) is a single attribute change. The W3C Design Tokens Community Group format (design-tokens.org) is the emerging interchange standard, expressed as JSON with $value, $type, and $description; tooling (Style Dictionary, Tokens Studio, Terrazzo) transforms it into platform outputs (CSS variables, iOS catalogs, Android resources).
Runtime switching has three operational pieces: persistence (localStorage or a cookie if SSR-sensitive), application (a class or data attribute on the document root before first paint to avoid flash), and propagation (notify components that read theme imperatively — chart libraries, canvases). The pre-paint application typically requires a small inline script in the document head that runs before the stylesheet loads.
Theme contracts make additive changes safe and breaking changes visible. Adding a new system token is safe; renaming or removing one is a breaking change requiring a deprecation cycle. Components that read tokens by exact name should not be expected to handle missing tokens gracefully — a missing token resolves to the CSS variable's fallback value (or invalid, depending on the property), which is rarely what's wanted in production.
The indirection earns its complexity by separating two rates of change: brand decisions change rarely, theme assignments (which brand color means "danger") change occasionally, and components change continuously. A flat token system collapses these into one rate and forces every component to know about every brand value. The three-tier model gives each rate of change its own surface to evolve on.
Semantic names beat descriptive names. color.background.surface tells a component author what to use; color.gray.100 forces them to know that gray.100 happens to be the surface color today and changes meaning when the theme flips. The discipline is to resist convenience names that leak appearance into the contract.
<!-- skill-graph-context:start (generated — do not edit by hand) -->
Classification
frontend-engineeringtrueengineering/frontendWhen to use
theme system, design tokens, theme switching, css variables for theming, token architectureNot for
Related skills
color-system-design, design-system-architecture, visual-design-foundations, dark-mode-implementation, typography-systemConcept
Keywords
theme token contract, theme semantic layer, theme variables, css custom properties, runtime theme switching, token tiers, theme contract, design tokens community group, theme parity, token naming<!-- skill-graph-context:end -->
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.