v7.3.0 llm.txt Download
Docs04 · Usage: sizes, styles, colour, accessibility

Reference · docs/reference/usage.md

04 · Usage: sizes, styles, colour, accessibility

Pick a size, then a style

Size Where Style
12 px inline in captions, badges, table cells Bold
16 px menus, dense toolbars, inputs, list rows Regular; Bold on busy or tinted surfaces
20 px default: buttons, nav, cards Regular
24 px primary nav, empty-state headers, mobile tab bar Regular; Fill for the selected tab
32 px feature lists, onboarding, settings sections Light or Duotone
48 px+ marketing, illustrations, hero rows Light, or a brand tile

Icons are drawn and tested at 12, 16, 20, 24, 32, 40 and 48. Anything else falls between pixel grids and blurs. A few icons that contain numerals or fine detail (forward-*, rewind-*, age-gate, language, …) are tested from 20 px. Their minSize is in the manifest, and <CsIcon> warns in development if you go smaller.

Styles by intent

  • Regular is the voice of the product. Use it unless you have a reason not to.
  • Bold is for small sizes and loud surfaces. Don't mix Bold and Regular in one row. For the active item in a navigation set, use Fill.
  • Light is for size. At 32 px and above, Regular starts to shout.
  • Fill is the solid form of the same icon: the selected tab, the active nav item, toggled-on states, toasts, alerts and form errors (Studio's "fill weight"). Pair it with Regular, so the same icon flips between line (at rest) and fill (selected).
  • Duotone marks a featured item, and works well in marketing feature lists. The plate takes --cs-icon-tone at --cs-icon-tone-opacity (default currentColor at 20 %). Inside Studio chrome, .cs-tone-accent turns the plate lime.

Colour

UI icons are monochrome and take the colour of their text (currentColor).

Situation Colour
Default the surrounding text colour (on-surface / on-surface-2)
Secondary, decorative on-surface-3 (still ≥ 3:1 against the surface for non-text graphics)
Interactive, hover / selected primary-line (lime as a line); fills only for the one primary action
Status success, warning, error on status icons only, always paired with a label
On lime on-primary (deep green), never white

Things never to do:

  • colour icons by category;
  • make colour the only difference between two states;
  • put a gradient in an icon;
  • recolour part of a UI icon.

If a part needs emphasis, it's either a brand asset with an accent layer or a Duotone plate.

Spacing and alignment

  • Icon and label: gap 0.5em (.cs-icon-label). The icon sits on the text's optical centre (vertical-align: -0.2em).
  • Icon-only buttons: hit target ≥ 40 × 40 (Studio toolbar 44). The icon stays at 20, centred.
  • Icon wells (Studio icon-well): 38 px, surface-2, radius md, 18–20 px icon. On hover the icon turns primary-line on a primary-soft well.
  • Never scale an icon to fill a container. Containers have padding; icons have a size.

Accessibility

  • Decorative icons (next to a text label) are hidden: aria-hidden="true". This is the default when no title is passed.

  • Meaningful icons (icon-only buttons, status without text) need a name. Put aria-label on the button, or pass title to the icon, not both.

  • Contrast: icons are non-text graphics and need ≥ 3:1 against their surface (WCAG 1.4.11). Measured values:

    Icon colour on surface on surface-2 dark: on surface dark: on surface-2
    on-surface 19.9 17.8 17.8 16.6
    on-surface-2 9.2 8.2 7.8 7.3
    on-surface-3 4.7 4.2 3.8 3.6
    on-surface-4 2.5 ✕ 2.2 ✕ 2.1 ✕ 2.0 ✕
    primary-line 3.1 2.8 ✕ 8.4 7.8
    on-primary on lime 9.9 — 13.7 —

    Use on-surface-4 only for disabled controls. Light theme lime: a primary-line icon passes only on surface. On surface-2 and on lime-tinted wells (Studio's icon-well-hover), it needs a text label next to it or the Bold style, or should stay on-surface. This is a Studio palette constraint, flagged for the Studio team: darkening primary-line to about L 60 % would clear 3:1 everywhere.

  • Forced colours / high contrast: icons follow currentColor, and the Duotone plate is hidden under forced-colors: active.

  • Motion: no animated icons ship. If you animate loader, honour prefers-reduced-motion.

  • Status always pairs a shape with a word. check-circle + "Saved", never a green dot alone.

Light and dark

Because UI icons are currentColor, there are no light and dark copies to choose between: one file works on both surfaces. Brand assets ship as ink, paper and lime tiles, plus a vars tile that follows tokens.css. File symbols, badges and illustrations ship light, dark and (where useful) vars.

The QA sheets render every icon at 16/20/24 in all five styles on Studio's surface (light) and dark-surface (dark). Re-run them with make qa before every release.