Tokens
Colour
Every colour role in light and dark, with its usage note and the contrast it holds: Kanso's own, the product roles in a sample product colour, and the Material Design roles the components read today.
Read from kanso-ui 0.59.0’s tokens.css, whose tokens are kanso-ui-core 0.8.0’s, with the usage notes of that release. Contrast is measured here, as WCAG 2 defines it.
Kanso's colours
--kui-color-accent-on-inkLight
#fafafaDark#121212Contrast on paper: light 1.0:1, dark 1.0:1
The product colour where the ground is ink: the action of a snackbar, its focus ring, a link on an ink band. The base is on-ink: 16.7:1 on ink in light, 15.9:1 in dark.
--kui-color-accent-softLight
#e9e9e9Dark#2b2b2bContrast on-accent-soft on accent-soft: light 14.3:1, dark 11.9:1
Quiet accent fills: a selected list row, the accent badge, a persona avatar that needs the product colour. The base is container.
--kui-color-accentLight
#1a1a1aDark#ecececContrast on-accent on accent: light 16.6:1, dark 15.8:1
The product colour: the one highlighted action per screen, the timeline's now mark, meter fills, the navigation pane's selection bar, links and the focus ring. The base is ink, since the brand has no colour of its own (16.7 and 17.4:1 on paper and surface in light; 15.9 and 14.4:1 in dark); a product sets its own through defineProductTheme, with every role that reads the accent following it.
--kui-color-caution-softLight
#ffe7ccDark#4a2a00Contrast on-caution-soft on caution-soft: light 9.5:1, dark 10.0:1
Fill of the late badge and the caution inline alert. The caution icon on it holds 4.0:1 in light and 7.6:1 in dark.
--kui-color-caution-stripeLight
#ffc27aDark#7a4600Contrast on paper: light 1.5:1, dark 2.4:1
The second colour of the late hatch inside a meter, between caution stripes. A pattern only, never text.
--kui-color-cautionLight
#b25b00Dark#ffb870Contrast on paper: light 4.5:1, dark 11.0:1
Late and needs attention: the late mark, the attention icon, short text such as '1 late'. On paper and surface: 4.6 and 4.8:1 in light; 11.0 and 10.0:1 in dark. Always with a word or an icon too. Status text sits on paper or surface only; on surface-sunken or container a component uses the -soft pair or ink.
--kui-color-containerLight
#e9e9e9Dark#2b2b2bContrast on paper: light 1.1:1, dark 1.3:1
Tonal fills: the tonal button, a meter's empty track, a persona or team avatar without a person's own colour, the neutral badge.
--kui-color-critical-softLight
#fcdedcDark#4d1512Contrast on-critical-soft on critical-soft: light 10.6:1, dark 11.3:1
Fill of the critical inline alert.
--kui-color-criticalLight
#b3261eDark#f2b8b5Contrast on-critical on critical: light 6.5:1, dark 7.6:1
Validation errors and destructive actions only, kept apart from negative so a negative balance never reads as a broken field. On paper and surface: 6.3 and 6.5:1 in light; 11.0 and 10.0:1 in dark. Status text sits on paper or surface only; on surface-sunken or container a component uses the -soft pair or ink.
--kui-color-dividerLight
#e3e3e3Dark#333333Contrast on paper: light 1.2:1, dark 1.4:1
Hairlines between list rows and table rows, and decorative borders. Never the only boundary of a control: controls take outline.
--kui-color-focus-ringLight
#1a1a1aDark#ecececContrast on paper: light 16.6:1, dark 15.8:1
Keyboard focus: a 2px solid ring drawn 2px outside the control, in the accent. On the base, ink: 16.7:1 on paper in light and 15.9:1 in dark. On spotlight the ring is on-spotlight.
--kui-color-ink-mutedLight
#5c5c5cDark#b3b3b3Contrast on paper: light 6.4:1, dark 8.9:1
Secondary text: supporting lines, captions, labels above fields, inactive navigation items and icons. On paper, surface, surface-sunken and container: 6.4, 6.7, 5.9 and 5.5:1 in light; 8.9, 8.1, 7.2 and 6.7:1 in dark.
--kui-color-inkLight
#1a1a1aDark#ecececContrast on-ink on ink: light 16.6:1, dark 15.8:1
Text and icons on paper, surface, surface-sunken and container: 16.7, 17.4, 15.3 and 14.3:1 in light; 15.9, 14.4, 12.8 and 12.0:1 in dark. Also the fill of the strong (ink) button, the FAB, a checked control, a selected filter chip and the active navigation pill.
--kui-color-inverse-errorLight
#f2b8b5Dark#b3261eContrast on paper: light 1.6:1, dark 2.8:1
A failure's mark on `kui-color-inverse-surface`, such as the warning glyph that leads a failed action's snackbar: the other scheme's `kui-color-critical`, which is what clears contrast there.
--kui-color-kanso-surfaceLight
#ffffffDark#1c1c1cContrast on paper: light 1.0:1, dark 1.0:1
Cards, sheets, dialogs, menus, the navigation bar and the selected item of the navigation pane: anything lifted one step off paper. Pair it with shadow-1 or a higher shadow.
--kui-color-negative-softLight
#fce3dcDark#4a1a10Contrast on-negative-soft on negative-soft: light 10.8:1, dark 11.1:1
Fill of the negative badge.
--kui-color-negativeLight
#a63a1fDark#ffb4a1Contrast on-negative on negative: light 6.1:1, dark 10.9:1
Negative balances and losses, never errors. On paper and surface: 6.2 and 6.5:1 in light; 11.0 and 10.0:1 in dark. Amounts also carry a − sign; a balance that is neither a gain nor a loss stays ink. Status text sits on paper or surface only; on surface-sunken or container a component uses the -soft pair or ink.
--kui-color-on-accent-softLight
#1a1a1aDark#ecececContrast on accent-soft: light 14.3:1, dark 11.9:1
Text and icons on accent-soft. The base is ink: 14.3:1 in light, 12.0:1 in dark.
--kui-color-on-accentLight
#fafafaDark#121212Contrast on accent: light 16.6:1, dark 15.8:1
Text and icons on accent fills. The base is on-ink: 16.7:1 in light, 15.9:1 in dark.
--kui-color-on-caution-softLight
#5c2e00Dark#ffddb3Contrast on caution-soft: light 9.5:1, dark 10.0:1
Text on caution-soft: 9.5:1 in light, 10.0:1 in dark.
--kui-color-on-critical-softLight
#5f0e0aDark#ffdad6Contrast on critical-soft: light 10.6:1, dark 11.3:1
Text on critical-soft: 10.7:1 in light, 11.0:1 in dark.
--kui-color-on-criticalLight
#ffffffDark#601410Contrast on critical: light 6.5:1, dark 7.6:1
Text on critical fills, such as a destructive button: 6.5:1 in light, 7.7:1 in dark.
--kui-color-on-inkLight
#fafafaDark#121212Contrast on ink: light 16.6:1, dark 15.8:1
Text and icons on ink fills: 16.7:1 in light and 15.9:1 in dark.
--kui-color-on-negative-softLight
#5a1a0aDark#ffdad0Contrast on negative-soft: light 10.8:1, dark 11.1:1
Text on negative-soft: 10.8:1 in light, 11.2:1 in dark.
--kui-color-on-positive-softLight
#0b3a1bDark#c6f2d2Contrast on positive-soft: light 10.9:1, dark 10.3:1
Text on positive-soft: 10.9:1 in light, 10.3:1 in dark.
--kui-color-on-spotlight-button#1a1a1aContrast on spotlight-button: light 16.6:1, dark 17.4:1
Label of the main action inside the spotlight card, on its paper pill: ink in both schemes, 16.7:1 in light and 17.4:1 in dark.
--kui-color-on-spotlight-mutedrgba(255, 255, 255, 0.8)Supporting text on spotlight (the eyebrow, the details and time): 11.4:1 in light and 9.6:1 in dark on the base spotlight.
--kui-color-on-spotlight#ffffffContrast on spotlight: light 17.4:1, dark 14.1:1
Titles, icons and the focus ring on spotlight: 17.4:1 in light, 14.0:1 in dark on the base spotlight.
--kui-color-outlineLight
#8a8a8aDark#8c8c8cContrast on paper: light 3.3:1, dark 5.5:1
Boundaries of controls: text fields, the outlined button, checkboxes, radios, the switch track when off, a chip when not selected, the selected segment. 3.3:1 on paper and 3.5:1 on surface in light; 5.6:1 on paper and 5.1:1 on surface in dark.
--kui-color-paperLight
#fafafaDark#121212Contrast ink on paper: light 16.6:1, dark 15.8:1
The page itself: the ground every screen is painted on. Brand paper in light, night in dark. Lists and timeline rows sit flat on it.
--kui-color-positive-softLight
#ddf2e2Dark#123a20Contrast on-positive-soft on positive-soft: light 10.9:1, dark 10.3:1
Fill of the positive badge and the positive inline alert.
--kui-color-positiveLight
#1e6b35Dark#7bd99aContrast on-positive on positive: light 6.2:1, dark 10.9:1
Done, and positive balances. Text and icons on paper and surface: 6.3 and 6.5:1 in light; 10.9 and 9.9:1 in dark. Amounts also carry a + sign. Status text sits on paper or surface only; on surface-sunken or container a component uses the -soft pair or ink.
--kui-color-scrimLight
rgba(0, 0, 0, 0.4)Darkrgba(0, 0, 0, 0.6)Behind a dialog or a modal sheet. The value carries its own opacity.
--kui-color-shadow#000000Contrast on paper: light 20.1:1, dark 1.1:1
The ink of elevation shadows: black, as every Kanso shadow is drawn.
--kui-color-spotlight-buttonLight
#fafafaDark#ffffffContrast on-spotlight-button on spotlight-button: light 16.6:1, dark 17.4:1
The main action inside the spotlight card: a paper pill.
--kui-color-spotlight-linergba(255, 255, 255, 0.6)The border of an outlined button inside the spotlight card: 3.8:1 on spotlight.
--kui-color-spotlight-tonalLight
rgba(255, 255, 255, 0.16)Darkrgba(255, 255, 255, 0.14)Secondary buttons inside the spotlight card; their label is on-spotlight, and their hover and pressed layers are on-spotlight at 8% and 12%. On the base spotlight the label is 10.6:1 at rest and 7.4:1 pressed in light, 9.0:1 and 6.4:1 in dark. A theme that sets a spotlight without its own tonal fill gets on-spotlight mixed into the spotlight, up to 16%, as far as keeps the pressed label at 4.5:1.
--kui-color-spotlightLight
#1a1a1aDark#2b2b2bContrast on-spotlight on spotlight: light 17.4:1, dark 14.1:1
The spotlight card: the one thing that needs the person now. One per screen, never a decoration. The base is a deep neutral in both schemes, ink in light and container in dark, so its content stays white.
--kui-color-surface-sunkenLight
#f0f0f0Dark#262626Contrast on paper: light 1.0:1, dark 1.2:1
Recessed fills on paper or surface: the search field, the segmented control's track, hover and pressed rows. Never a card.
The product roles, in a sample
The roles a product sets, here in the sample product colour, violet, kanso-ui-core’s demoProductThemes.violet, which belongs to no product. Each product supplies its own through defineProductTheme, which checks every pair against Kanso’s contrast targets in both schemes. Every role that follows these, kui-color-primary and the focus ring among them, follows the product; every other colour stays the base’s.
--kui-color-accentLight
#6b3fa0Dark#cdb0f5The product colour: the one highlighted action per screen, the timeline's now mark, meter fills, the navigation pane's selection bar, links and the focus ring. The base is ink, since the brand has no colour of its own (16.7 and 17.4:1 on paper and surface in light; 15.9 and 14.4:1 in dark); a product sets its own through defineProductTheme, with every role that reads the accent following it.
--kui-color-on-accentLight
#ffffffDark#2a0d4aText and icons on accent fills. The base is on-ink: 16.7:1 in light, 15.9:1 in dark.
--kui-color-accent-softLight
#efe6f8Dark#3b2557Quiet accent fills: a selected list row, the accent badge, a persona avatar that needs the product colour. The base is container.
--kui-color-on-accent-softLight
#3f1d63Dark#eadcfcText and icons on accent-soft. The base is ink: 14.3:1 in light, 12.0:1 in dark.
--kui-color-accent-on-inkLight
#c9a8f0Dark#6b3fa0The product colour where the ground is ink: the action of a snackbar, its focus ring, a link on an ink band. The base is on-ink: 16.7:1 on ink in light, 15.9:1 in dark.
--kui-color-spotlightLight
#6b3fa0Dark#553186The spotlight card: the one thing that needs the person now. One per screen, never a decoration. The base is a deep neutral in both schemes, ink in light and container in dark, so its content stays white.
--kui-color-on-spotlight#ffffffTitles, icons and the focus ring on spotlight: 17.4:1 in light, 14.0:1 in dark on the base spotlight.
--kui-color-on-spotlight-mutedrgba(255, 255, 255, 0.8)Supporting text on spotlight (the eyebrow, the details and time): 11.4:1 in light and 9.6:1 in dark on the base spotlight.
--kui-color-spotlight-buttonLight
#fafafaDark#ffffffThe main action inside the spotlight card: a paper pill.
--kui-color-on-spotlight-button#3f1d63Label of the main action inside the spotlight card, on its paper pill: ink in both schemes, 16.7:1 in light and 17.4:1 in dark.
--kui-color-spotlight-tonalSecondary buttons inside the spotlight card; their label is on-spotlight, and their hover and pressed layers are on-spotlight at 8% and 12%. On the base spotlight the label is 10.6:1 at rest and 7.4:1 pressed in light, 9.0:1 and 6.4:1 in dark. A theme that sets a spotlight without its own tonal fill gets on-spotlight mixed into the spotlight, up to 16%, as far as keeps the pressed label at 4.5:1.
--kui-color-spotlight-linergba(255, 255, 255, 0.6)The border of an outlined button inside the spotlight card: 3.8:1 on spotlight.
Material Design roles
The roles kanso-ui’s components read today, each the Kanso colour it takes until its component moves to Kanso’s own.
| Role | Takes | Light | Dark |
|---|---|---|---|
--kui-color-background | paper | #fafafa | #121212 |
--kui-color-error-container | critical-soft | #fcdedc | #4d1512 |
--kui-color-error | critical | #b3261e | #f2b8b5 |
--kui-color-inverse-on-surface | on-ink | #fafafa | #121212 |
--kui-color-inverse-primary | accent-on-ink | #fafafa | #121212 |
--kui-color-inverse-surface | ink | #1a1a1a | #ececec |
--kui-color-negative-container | negative-soft | #fce3dc | #4a1a10 |
--kui-color-on-background | ink | #1a1a1a | #ececec |
--kui-color-on-error-container | on-critical-soft | #5f0e0a | #ffdad6 |
--kui-color-on-error | on-critical | #ffffff | #601410 |
--kui-color-on-negative-container | on-negative-soft | #5a1a0a | #ffdad0 |
--kui-color-on-negative | paper | #fafafa | #121212 |
--kui-color-on-positive-container | on-positive-soft | #0b3a1b | #c6f2d2 |
--kui-color-on-positive | paper | #fafafa | #121212 |
--kui-color-on-primary-container | on-accent-soft | #1a1a1a | #ececec |
--kui-color-on-primary-fixed-variant | on-accent-soft | #1a1a1a | #ececec |
--kui-color-on-primary-fixed | on-accent-soft | #1a1a1a | #ececec |
--kui-color-on-primary | on-accent | #fafafa | #121212 |
--kui-color-on-secondary-container | ink | #1a1a1a | #ececec |
--kui-color-on-secondary-fixed-variant | on-accent-soft | #1a1a1a | #ececec |
--kui-color-on-secondary-fixed | on-accent-soft | #1a1a1a | #ececec |
--kui-color-on-secondary | on-ink | #fafafa | #121212 |
--kui-color-on-surface-variant | ink-muted | #5c5c5c | #b3b3b3 |
--kui-color-on-surface | ink | #1a1a1a | #ececec |
--kui-color-on-tertiary-container | on-accent-soft | #1a1a1a | #ececec |
--kui-color-on-tertiary-fixed-variant | on-accent-soft | #1a1a1a | #ececec |
--kui-color-on-tertiary-fixed | on-accent-soft | #1a1a1a | #ececec |
--kui-color-on-tertiary | on-accent-soft | #1a1a1a | #ececec |
--kui-color-outline-variant | divider | #e3e3e3 | #333333 |
--kui-color-positive-container | positive-soft | #ddf2e2 | #123a20 |
--kui-color-primary-container | accent-soft | #e9e9e9 | #2b2b2b |
--kui-color-primary-fixed-dim | accent-soft | #e9e9e9 | #2b2b2b |
--kui-color-primary-fixed | accent-soft | #e9e9e9 | #2b2b2b |
--kui-color-primary | accent | #1a1a1a | #ececec |
--kui-color-secondary-container | container | #e9e9e9 | #2b2b2b |
--kui-color-secondary-fixed-dim | accent-soft | #e9e9e9 | #2b2b2b |
--kui-color-secondary-fixed | accent-soft | #e9e9e9 | #2b2b2b |
--kui-color-secondary | ink | #1a1a1a | #ececec |
--kui-color-surface-bright | kanso-surface | #ffffff | #1c1c1c |
--kui-color-surface-container-high | kanso-surface | #ffffff | #1c1c1c |
--kui-color-surface-container-highest | surface-sunken | #f0f0f0 | #262626 |
--kui-color-surface-container-low | kanso-surface | #ffffff | #1c1c1c |
--kui-color-surface-container-lowest | kanso-surface | #ffffff | #1c1c1c |
--kui-color-surface-container | kanso-surface | #ffffff | #1c1c1c |
--kui-color-surface-dim | paper | #fafafa | #121212 |
--kui-color-surface-tint | accent | #1a1a1a | #ececec |
--kui-color-surface-variant | surface-sunken | #f0f0f0 | #262626 |
--kui-color-surface | paper | #fafafa | #121212 |
--kui-color-tertiary-container | accent-soft | #e9e9e9 | #2b2b2b |
--kui-color-tertiary-fixed-dim | accent-soft | #e9e9e9 | #2b2b2b |
--kui-color-tertiary-fixed | accent-soft | #e9e9e9 | #2b2b2b |
--kui-color-tertiary | accent-soft | #e9e9e9 | #2b2b2b |