> cs·fundamentals
interview 0% 26m read
8.7 ★ core [B][J] 1 interview Q's

Design systems, tokens & component kits

Professional UI is consistent because it's built from reused, tokenized parts — not hand-tuned per screen. Think in tokens and components, and pick a kit. This very course is the worked example.

Professional UIs are consistent because they’re assembled from reused, tokenized parts — not hand-tuned screen by screen. Once you think in tokens and components, two things happen: your app stops drifting, and your single most powerful instruction to an AI becomes “reuse what we already have.” This very course is the worked example — its colours, spacing, and type all come from a token file.

Tokens: change one value, change everywhere

A design token is a named value you reference instead of hardcoding. Rather than typing #3fb950 in forty places, you define --accent once and use it everywhere; change the token and the whole app moves together. The win is twofold: consistency (nothing drifts because everything points at the same source) and changeability (a rebrand or a dark mode is a token edit, not a find-and-replace). This site enforces exactly that — every colour is a token, and a build step rejects any raw hex that isn’t one.

A token named accent points to a Button component, which points to three screens, showing one value cascading everywhere.—accent#3fb950<Button>checkout screensettings screendashboard screen
FIG 1 · one token, the whole app A single --accent token feeds the Button component, which feeds every screen. Change the token and all of it updates at once.

Reuse: the cure for drift

The reason consistency is hard by hand is that every new screen is a chance to make a slightly different button. A shared component removes that chance: define <Button> once and every instance matches automatically, forever. The anti-pattern is the snowflake — a one-off component built for a single screen that quietly diverges from the rest. When you direct an AI, the highest-leverage rule is “use the existing component, don’t invent a new one” — it’s the single biggest consistency win available.

Tokens as the single source of truth (this site's own)
/* tokens.css — every colour/space/type value lives here, once */
:root {
  --accent: #3fb950;     /* the one brand colour */
  --text:   #e6edf3;
  --border: #30363d;
  --space-4: 16px;       /* an 8-pt spacing step */
  --radius:  8px;
}
/* light theme overrides ONLY the colour tokens */
:root[data-theme="light"] { --text: #1f2328; --border: #d0d7de; }

Components never write a raw #3fb950 — they reference var(--accent). That’s why this site can flip light/dark by swapping a handful of values, and why a build check can fail on any stray hex. “Match our tokens” is a real, enforceable instruction.

Picking a kit

You rarely hand-build components anymore — you start from a kit. The three tiers differ in how much they style for you and how much control (and ownership) you keep.

KitWhat you getYou controlReach for it when
shadcn/uicomponents copied into your repoeverything — it's your codeyou want full control + own the code
Radixunstyled, accessible primitivesall the stylingyou have a design and need solid behaviour
MUI / Materiala complete styled systemless — you adapt their lookyou want polished UI fast, one cohesive look
All three give you accessible behaviour; they differ in how much look-and-feel is decided for you.

01 Learning objectives

0 / 6 done

02 Curated reading

03 Knowledge check

knowledge check3 questions · pass ≥ 70%
  1. 01easy

    A design token is…

  2. 02easy

    Supporting light and dark mode is mostly a matter of overriding the colour tokens.

  3. 03medium

    Which component kit gives you unstyled, accessible primitives you style yourself?

04 Interview questions

browse all ↗

What gets asked on this topic — tap a card for how to approach it, the follow-ups, and the trap. Company tags are best-effort & sourced.

  • Commonly asked junior concept occasional What is a design token, and why reference one instead of a raw hex or pixel value?

    A design token is a named design value — --accent, --space-4, --radius — that you reference everywhere instead of hardcoding #3fb950 or 16px. The payoff is consistency (everything points at one source, so nothing drifts) and changeability (a rebrand or a dark mode is a token edit, not a find-and-replace). Semantic names (--text, --accent) survive a theme switch in a way raw values can't. It's also the single most useful instruction to give an AI: 'match our tokens'.

    What a strong answer covers
    • A token is a named value referenced instead of a raw hex/px.

    • Consistency: one source of truth, no drift.

    • Changeability: theming/rebrand is a token edit, not search-replace.

    • Semantic names (--accent, --text) survive theme changes.

    Red flag Letting hardcoded values creep in alongside tokens — they won't theme and they quietly break the scale.

    source: CSS-Tricks — What Are Design Tokens? ↗