Skip to content
Skills Library
Design & UX · Building & coding

design-token-system

/design-token-system

Build a three-tier token architecture (global, semantic, component) with theming. Use when setting up design tokens, adding themes or dark mode to a design system, or untangling hard-coded colors and spacing.

Repository
skills ↗
Licence
MIT
Last repository change
13.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 13.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Build a three-tier token architecture (global, semantic, component) with theming. Use when setting up design tokens, adding themes or dark mode to a design system, or untangling hard-coded colors and spacing.

Original author description

Build a three-tier token architecture (global, semantic, component) with theming. Use when setting up design tokens, adding themes or dark mode to a design system, or untangling hard-coded colors and spacing.

How it works

  1. The three tiers
  2. Why three tiers
  3. Theming with token sets
  4. Naming convention
  5. Token categories to cover
  6. Tooling
  7. Guardrails
  8. Output
Original SKILL.md headings · 105 lines, 398 words
SKILL.md preview
---
name: design-token-system
description: Build a three-tier token architecture (global, semantic, component) with theming. Use when setting up design tokens, adding themes or dark mode to a design system, or untangling hard-coded colors and spacing.
metadata:
  title: "Design Token System"
---

# Design Token System

Use this skill to design a scalable token architecture that survives rebrands,
theming, and growth - instead of hard-coded values sprinkled through the codebase.

## The three tiers

### Tier 1: Global (primitive) tokens

Raw values with no meaning attached. The full palette of options.

```js
const global = {
  blue500: '#3B82F6',
  gray900: '#111827',
  space4: '16px',
  fontSize3: '18px',
};
```

Rules: name by value, never by use. `blue500`, not `primary`. Components never
reference these directly.

### Tier 2: Semantic (alias) tokens

Assign meaning by pointing at globals. This is where theming lives.

```js
const semantic = {
  colorTextPrimary: global.gray900,
  colorActionDefault: global.blue500,
  colorSurfaceBase: global.white,
  spaceInline: global.space4,
};
```

Rules: name by intent (`colorActionDefault`), not appearance (`colorBlue`). Most
components consume this tier.

### Tier 3: Component tokens

Optional, for components that need fine control. Point at semantic tokens.

```js
const button = {
  buttonBackground: semantic.colorActionDefault,
  buttonText: semantic.colorTextOnAction,
  buttonPaddingX: semantic.spaceInline,
};
```

## Why three tiers

- A rebrand changes **global** values; semantics and components follow automatically.
- A theme (dark mode) re-points **semantic** tokens to different globals.
- A one-off component tweak touches only its **component** tokens, not the system.

## Theming with token sets

Define one semantic set per theme that re-points to the same global palette:

```js
const semanticDark = {
  colorTextPrimary: global.gray050,
  colorSurfaceBase: global.gray900,
  colorActionDefault: global.blue400, // lightened for dark surfaces
};
```

Components reference `colorSurfaceBase`; switching the active semantic set flips
the whole theme with zero component changes.

## Naming convention

Adopt a predictable structure: `category-property-variant-state`.

- `color-text-primary`
- `color-action-default-hover`
- `space-inline-sm`

Keep it consistent and machine-parseable so tooling can generate platform outputs.

## Token categories to cover

Color, spacing, typography (family, size, weight, line-height, letter-spacing),
radii, borders, shadows, z-index, motion (duration, easing), and breakpoints.

## Tooling

- Store source tokens as JSON (W3C DTCG format) so they are platform-agnostic.
- Use Style Dictionary or similar to transform into CSS variables, JS, iOS, Android.
- Validate references resolve and no component points directly at a global.

## Guardrails

- No raw hex or px in component code - everything resolves through tokens.
- Every semantic token must have a value in every theme.
- Deprecate, don't delete: keep an alias when renaming so consumers migrate gradually.

## Output

Deliver the three-tier JSON source, a light and dark semantic set, the naming
convention doc, and the build config that emits platform-specific token files.

Versions

The database has no other skills named design-token-system.

Database snapshot: 13.11.2026 · package version 5c2c664a26a2 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 3 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100design-tokens
    Builds a design-token architecture: primitive, semantic and component token layers, token JSON, generated CSS variables, spacing and type scales, component state specs, and checks for hard- coded values. Use when the user asks for design tokens, a token system, CSS variables…
  • 100design-token-discipline
    Enforce that colors, spacing, type sizes, radii and z-indexes come from a small named token set instead of hard-coded values, and design the token layers so a rebrand, dark mode or density change is a one-file edit. Use when building or reviewing UI styling, theming, or a design…
  • 100token-architecture
    Use when building or restructuring design token systems — global tokens, semantic tokens, component tokens, naming conventions, theming, and multi-platform token distribution
  • 90frontend-design-system
    Use this skill when the user says 'design system', 'design tokens', 'component library', 'theme', 'colors', 'typography system', 'spacing system', 'component API design', 'variant system', or when creating or extending a frontend design system. This skill enforces: three-tier…
  • 100token-builder
    Build a two-tier (primitive + semantic) design token system as Figma variables — color ramps, spacing, type scale, radius, shadows — with light/dark or brand modes, using one collection per category per tier. Use this when the user wants to create design tokens, design…
  • 90optics-context
    Styles Rails views with RoleModel's Optics design system — its components, `--op-` design tokens, and theme overrides. Use when writing or reviewing CSS, styling a view or component, picking a color, spacing, font, radius, or shadow value, fixing hard-coded CSS values, adding a…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.