Skip to main content

Design tokens, visually

This page is the visual companion to the Design system pages. It draws the tokens in both themes at once, whichever theme you chose for the site, and gives every value as text in a table beside the drawing.

It is generated when the site is built, from the values @mapcairn/theme exports. The contrast ratios use the same maths the SDK's tests use.

Colour​

Light theme colours​

Each sample below is the pair as the interface draws it. The table gives its measured contrast ratio and whether it meets the 4.5:1 limit for text and the 3:1 limit for icons, control edges and the focus ring. Surfaces are flattened over the theme's page background, as they are on this page.

Contrast of the pairs, light theme​

PairUsed asRatio4.5:13:1
Text on surfaceText17.10:1PassPass
Muted text on surfaceText7.66:1PassPass
Accent on surfaceText7.14:1PassPass
Error text on surfaceText7.05:1PassPass
Text on selected tintText14.10:1PassPass
Error text on error tintText6.12:1PassPass
Text on accentText7.22:1PassPass
Text on pageText14.95:1PassPass
Muted text on pageText6.70:1PassPass
Control edge on surfaceNon-text5.21:1PassPass
Focus ring on surfaceNon-text4.86:1PassPass

Every colour role, light theme​

RoleValue
surfaceoklch(1 0 0 / 0.92)
surfaceRaisedoklch(1 0 0 / 0.94)
textoklch(0.22 0.01 250)
textMutedoklch(0.44 0.012 250)
accentoklch(0.46 0.15 255)
accentTintoklch(0.93 0.032 255)
accentContrastoklch(1 0 0)
hairlineoklch(0.22 0.01 250 / 0.12)
controlBoundaryoklch(0.53 0.012 250)
chromeBordertransparent
dangeroklch(0.48 0.17 27)
dangerTintoklch(0.95 0.024 25)
scrimoklch(0 0 0 / 0.4)
focusRingoklch(0.55 0.175 255)
focusRingInneroklch(1 0 0)
pageBackgroundoklch(0.95 0.008 85)
mapBackground#f8f4f0
mapGlobeSpaceoklch(0.82 0.02 250)
mapPinoklch(0.55 0.175 255)
mapMeasureLineoklch(0.55 0.175 255)
mapMeasureFilloklch(0.55 0.175 255 / 0.18)
mapAccuracyoklch(0.55 0.175 255)
mapAccuracyFilloklch(0.55 0.175 255 / 0.12)
mapHalooklch(1 0 0)

Dark theme colours​

Each sample below is the pair as the interface draws it. The table gives its measured contrast ratio and whether it meets the 4.5:1 limit for text and the 3:1 limit for icons, control edges and the focus ring. Surfaces are flattened over the theme's page background, as they are on this page.

Contrast of the pairs, dark theme​

PairUsed asRatio4.5:13:1
Text on surfaceText17.04:1PassPass
Muted text on surfaceText11.97:1PassPass
Accent on surfaceText9.82:1PassPass
Error text on surfaceText10.11:1PassPass
Text on selected tintText12.69:1PassPass
Error text on error tintText7.74:1PassPass
Text on accentText10.25:1PassPass
Text on pageText15.30:1PassPass
Muted text on pageText10.75:1PassPass
Control edge on surfaceNon-text6.86:1PassPass
Focus ring on surfaceNon-text7.94:1PassPass

Every colour role, dark theme​

RoleValue
surfaceoklch(0.19 0.008 250 / 0.92)
surfaceRaisedoklch(0.25 0.009 250 / 0.88)
textoklch(0.975 0.003 250)
textMutedoklch(0.86 0.007 250)
accentoklch(0.8 0.095 255)
accentTintoklch(0.3 0.06 255)
accentContrastoklch(0.17 0.008 250)
hairlineoklch(1 0 0 / 0.14)
controlBoundaryoklch(0.7 0.01 250)
chromeBordertransparent
dangeroklch(0.82 0.095 25)
dangerTintoklch(0.3 0.07 25)
scrimoklch(0 0 0 / 0.6)
focusRingoklch(0.74 0.125 255)
focusRingInneroklch(0.19 0.008 250)
pageBackgroundoklch(0.24 0.008 250)
mapBackground#45516e
mapGlobeSpaceoklch(0.31 0.025 255)
mapPinoklch(0.74 0.125 255)
mapMeasureLineoklch(0.74 0.125 255)
mapMeasureFilloklch(0.55 0.175 255 / 0.28)
mapAccuracyoklch(0.74 0.125 255)
mapAccuracyFilloklch(0.55 0.175 255 / 0.2)
mapHalooklch(0.19 0.008 250)

Type scale​

Every step is set in IBM Plex Sans, the interface's one typeface. Sizes are in rem, so they follow the reader's own font size, and only the weights 400 and 600 exist.

StepSizeLine heightTracking
type.small0.8125rem1.40.01em
type.body0.9375rem1.450em
type.large1.0625rem1.4-0.005em
type.title1.375rem1.25-0.015em
type.display2.5rem1.1-0.025em
WeightValue
type.weight.regular400
type.weight.semibold600

Spacing and radius​

Spacing bars are drawn at four times their size so the smallest step can be seen. Each radius is shown on the same square.

TokenValue
space.xxs4px
space.xs8px
space.sm12px
space.md16px
space.lg24px
space.xl32px
TokenValue
radius.pill24px
radius.sheet20px
radius.control14px
radius.inner10px
radius.round50%

Component specimens​

Specimens, light theme​

These are plain markup styled by the tokens alone, with no script, so they show the colours and shapes but do not respond.

SpecimenDeclarations
Secondary buttonbackground: color.surfaceRaised, color: color.text, border-color: color.controlBoundary, border-radius: radius.control, min-height: size.control, padding-inline: space.md, font-weight: type.weight.semibold
Primary buttonbackground: color.accent, color: color.accentContrast, border-color: color.accent, border-radius: radius.control, min-height: size.control, padding-inline: space.md, font-weight: type.weight.semibold
Text fieldbackground: color.surfaceRaised, color: color.textMuted, border-color: color.controlBoundary, border-radius: radius.control, min-height: size.control, padding-inline: space.md
Chipbackground: color.accentTint, color: color.text, border-color: color.accent, border-radius: radius.pill, padding-inline: space.sm, padding-block: space.xxs
Surfacebackground: color.surface, color: color.text, box-shadow: shadow.floating, border-radius: radius.sheet, padding: space.md
Raised surfacebackground: color.surfaceRaised, color: color.text, box-shadow: shadow.floating, border-radius: radius.sheet, padding: space.md
Focus ringoutline: focusRing.outline, outline-offset: focusRing.outlineOffset, box-shadow: focusRing.boxShadow

Specimens, dark theme​

These are plain markup styled by the tokens alone, with no script, so they show the colours and shapes but do not respond.

SpecimenDeclarations
Secondary buttonbackground: color.surfaceRaised, color: color.text, border-color: color.controlBoundary, border-radius: radius.control, min-height: size.control, padding-inline: space.md, font-weight: type.weight.semibold
Primary buttonbackground: color.accent, color: color.accentContrast, border-color: color.accent, border-radius: radius.control, min-height: size.control, padding-inline: space.md, font-weight: type.weight.semibold
Text fieldbackground: color.surfaceRaised, color: color.textMuted, border-color: color.controlBoundary, border-radius: radius.control, min-height: size.control, padding-inline: space.md
Chipbackground: color.accentTint, color: color.text, border-color: color.accent, border-radius: radius.pill, padding-inline: space.sm, padding-block: space.xxs
Surfacebackground: color.surface, color: color.text, box-shadow: shadow.floating, border-radius: radius.sheet, padding: space.md
Raised surfacebackground: color.surfaceRaised, color: color.text, box-shadow: shadow.floating, border-radius: radius.sheet, padding: space.md
Focus ringoutline: focusRing.outline, outline-offset: focusRing.outlineOffset, box-shadow: focusRing.boxShadow

Code colours​

Code colours, light theme​

Code is the one place hues beyond the accent appear. The ratio is measured on the code block's background, the raised surface over the page.

RoleValueRatio4.5:1
keywordoklch(0.45 0.12 305)7.79:1Pass
stringoklch(0.45 0.09 155)7.05:1Pass
numberoklch(0.47 0.1 40)7.06:1Pass
commentoklch(0.49 0.012 250)6.20:1Pass
functionoklch(0.46 0.15 255)7.16:1Pass
classNameoklch(0.45 0.08 200)7.06:1Pass
propertyoklch(0.45 0.08 100)7.33:1Pass
punctuationoklch(0.44 0.012 250)7.68:1Pass
operatoroklch(0.34 0.011 250)11.64:1Pass

Code colours, dark theme​

Code is the one place hues beyond the accent appear. The ratio is measured on the code block's background, the raised surface over the page.

RoleValueRatio4.5:1
keywordoklch(0.8 0.1 305)8.31:1Pass
stringoklch(0.82 0.1 155)9.55:1Pass
numberoklch(0.82 0.1 40)8.89:1Pass
commentoklch(0.74 0.009 250)6.96:1Pass
functionoklch(0.8 0.095 255)8.60:1Pass
classNameoklch(0.82 0.08 200)9.46:1Pass
propertyoklch(0.84 0.09 100)9.88:1Pass
punctuationoklch(0.86 0.007 250)10.48:1Pass
operatoroklch(0.915 0.005 250)12.47:1Pass