MMeridian Design System
Reference

Design tokens

Tokens are the contract between design and code. They are named for meaning, not for value — --mrd-text-muted, never --mrd-grey-500.

Naming

--mrd-{category}-{role}-{variant}

--mrd-color-bg          page background
--mrd-color-text        primary text
--mrd-color-text-muted  secondary text
--mrd-accent            interactive / selected
--mrd-radius-sm         control corners

A token that only exists because one component needed it is not a token — it is a local variable and should stay inside that component.

Colour

TokenLightDark
--mrd-color-bg#FFFFFF#101312
--mrd-color-surface#FFFFFF#161A18
--mrd-color-surface-alt#F7F7F5#161A18
--mrd-color-line#E3E6E1#272D29
--mrd-color-text#171A18#ECEDEA
--mrd-color-text-soft#47504A#B1B7B1
--mrd-color-text-muted#737D76#868E88
--mrd-accent#1F6F5C#6FBFA4
--mrd-accent-soft#EAF4F0#16241F
--mrd-success#2F7D4F#5FB884
--mrd-warning#B0741C#D9A45E
--mrd-danger#A8322A#E0796F

Typography

TokenValue
--mrd-font-sanssystem-ui, -apple-system, "Segoe UI", Inter, Arial
--mrd-font-monoui-monospace, SFMono-Regular, Menlo, Consolas
--mrd-text-xs11px / 16px
--mrd-text-sm13px / 20px
--mrd-text-md15px / 26px
--mrd-text-lg16px / 24px
--mrd-text-xl20px / 28px
--mrd-text-2xl24px / 32px
--mrd-text-3xl32px / 40px

Space, radius, motion

TokenValue
--mrd-space-1 … 64 / 8 / 12 / 16 / 24 / 32 px
--mrd-radius-sm6px
--mrd-radius-md10px
--mrd-radius-pill999px
--mrd-easecubic-bezier(.2, .8, .3, 1)
--mrd-dur-fast120ms
--mrd-dur-base180ms

Density

Density is a single switch that recalculates spacing and control heights:

[data-density="compact"] {
  --mrd-row-h: 32px;
  --mrd-control-h: 28px;
  --mrd-space-2: 6px;
  --mrd-space-4: 12px;
}

Using tokens from JavaScript

Custom properties are readable at runtime, so canvas charts and virtualised lists can stay in sync with the theme without duplicating the palette:

const styles = getComputedStyle(document.documentElement);
const accent = styles.getPropertyValue("--mrd-accent").trim();
chart.update({ lineColor: accent });

Re-read them when the theme changes — a matchMedia("(prefers-color-scheme: dark)") listener is enough.

Versioning Token names are API. Renaming one is a breaking change and ships in a major version with a deprecation period of one minor release, during which both names resolve to the same value.