Tokens
Shape and elevation
Kanso's corners, its three shadows and the opacities of the state layers, in light and dark.
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.
Corners
Material Design's corner scale, from square to fully round. Kanso's corners, `kui-radius-kanso-*`: Soft but not round: every container keeps a clear corner, and every control is a pill.
--kui-radius-kanso-2xl24pxCards on phones.
--kui-radius-kanso-3xl28pxThe spotlight card, dialogs and the top corners of a sheet.
--kui-radius-kanso-lg16pxThe FAB and the cards of a dense web grid.
--kui-radius-kanso-md12pxText fields, menus, snackbars, inline alerts and navigation pane items.
--kui-radius-kanso-pill999pxEvery button, chip, badge, segmented control and the search field.
--kui-radius-kanso-sm8pxTooltips, team avatars, small thumbnails.
--kui-radius-kanso-xl20pxCards on the web.
--kui-radius-kanso-xs4pxSmall marks and the meter's segments.
Shadows
One shadow per elevation level, from Kanso's three: level 1 is shadow-1, level 2 shadow-2, levels 3 to 5 shadow-3. Three steps. Light shadows are two soft layers; dark shadows are deeper and the surface tone does most of the lifting.
--kui-shadow-kanso-1Light
0px 1px 2px 0px rgba(0, 0, 0, 0.06), 0px 2px 8px 0px rgba(0, 0, 0, 0.04)Dark0px 1px 2px 0px rgba(0, 0, 0, 0.5)Cards, the selected navigation pane item, the selected segment.
--kui-shadow-kanso-2Light
0px 2px 6px 0px rgba(0, 0, 0, 0.08), 0px 8px 20px 0px rgba(0, 0, 0, 0.1)Dark0px 4px 16px 0px rgba(0, 0, 0, 0.6)Things that float over content: the FAB, menus, snackbars, tooltips.
--kui-shadow-kanso-3Light
0px 8px 24px 0px rgba(0, 0, 0, 0.12), 0px 24px 56px 0px rgba(0, 0, 0, 0.14)Dark0px 12px 40px 0px rgba(0, 0, 0, 0.7)Dialogs and sheets, above the scrim.
State layers
State-layer opacities: the on-colour of a container, painted over it at this strength. Kanso's own, `kui-state-layer-opacity-kanso-*`: State layers: the content colour of a control, painted over it at this strength.
--kui-state-layer-opacity-kanso-disabled-container0.12A disabled control's fill: ink at this strength.
--kui-state-layer-opacity-kanso-disabled-content0.38A disabled control's label and icon: ink at this strength. Disabled controls are exempt from contrast rules, but say why they are disabled nearby.
--kui-state-layer-opacity-kanso-focus0.1Keyboard focus, together with the focus ring.
--kui-state-layer-opacity-kanso-hover0.08Pointer over a control.
--kui-state-layer-opacity-kanso-pressed0.12Pressed or dragged.
Material Design steps
--kui-radius-circle9999pxA circle on a square box: radio buttons, avatar marks, the loading indicator, slider handles.
--kui-radius-lg16pxLarge shape: the FAB, the calendar and date pickers, a sheet's corners, a square button at `lg`.
--kui-radius-md12pxMedium shape: cards, the drop zone, popovers and other overlays, a square button at the smaller sizes.
--kui-radius-none0pxSquare corners: a full-screen dialog, a sheet edge that meets the window, a segmented button's inner seams.
--kui-radius-pill9999pxFully rounded ends: buttons at rest, badges, the search bar, the navigation indicator, switches.
--kui-radius-sm8pxSmall shape: chips, tags, the copy field, colour areas and sliders, the time picker's fields.
--kui-radius-xl28pxExtra-large shape: dialogs, sheets, the search view, carousel items, the time picker, the largest buttons and FAB.
--kui-radius-xs4pxExtra-small shape: fields, menus, selects, snackbars, plain tooltips, keycaps.
--kui-shadow-elevation1Light
0px 1px 2px 0px rgba(0, 0, 0, 0.06), 0px 2px 8px 0px rgba(0, 0, 0, 0.04)Dark0px 1px 2px 0px rgba(0, 0, 0, 0.5)Level 1: elevated cards, buttons and chips at rest; a modal sheet. Kanso's `shadow-1`, deeper in dark.
--kui-shadow-elevation2Light
0px 2px 6px 0px rgba(0, 0, 0, 0.08), 0px 8px 20px 0px rgba(0, 0, 0, 0.1)Dark0px 4px 16px 0px rgba(0, 0, 0, 0.6)Level 2: menus, popovers and pickers; a hovered elevated card or button. Kanso's `shadow-2`, deeper in dark.
--kui-shadow-elevation3Light
0px 8px 24px 0px rgba(0, 0, 0, 0.12), 0px 24px 56px 0px rgba(0, 0, 0, 0.14)Dark0px 12px 40px 0px rgba(0, 0, 0, 0.7)Level 3: dialogs, the FAB, the snackbar, the search view. Kanso's `shadow-3`, deeper in dark.
--kui-shadow-elevation4Light
0px 8px 24px 0px rgba(0, 0, 0, 0.12), 0px 24px 56px 0px rgba(0, 0, 0, 0.14)Dark0px 12px 40px 0px rgba(0, 0, 0, 0.7)Level 4: a hovered FAB, a dragged row. Kanso's `shadow-3`, deeper in dark.
--kui-shadow-elevation5Light
0px 8px 24px 0px rgba(0, 0, 0, 0.12), 0px 24px 56px 0px rgba(0, 0, 0, 0.14)Dark0px 12px 40px 0px rgba(0, 0, 0, 0.7)Level 5: the highest lift; no component draws it. Kanso's `shadow-3`, deeper in dark.
--kui-state-layer-opacity-disabled-container0.12A disabled control's container: `kui-color-on-surface` at this opacity.
--kui-state-layer-opacity-disabled-content0.38A disabled control's label and icon: `kui-color-on-surface` at this opacity.
--kui-state-layer-opacity-dragged0.16The on-colour layered over an item while dragged.
--kui-state-layer-opacity-focus0.1The on-colour layered over a container while focused by keyboard.
--kui-state-layer-opacity-hover0.08The on-colour layered over a container while hovered.
--kui-state-layer-opacity-pressed0.1The on-colour layered over a container while pressed, under the ripple.