Skip to content
Eskais UI

Theming

Spacing and tokens

Spacing, type, elevation and motion are chosen by role, never by number. The values change with the density, so data-density="compact" tightens everything at once, and the corner radius is an axis of its own.

Spacing roles

Choose by relationship, not by look: parts of the same thing use gap-inline or gap-items, distinct groups gap-group, separate surfaces gap-section. Every spacing utility takes the roles: p-inline, pb-group, -mx-inline. The Compact column is data-density="compact" (or the data-theme="compact" alias), at any radius; Theming covers both axes.

UtilityRoleDefaultCompact
gap-inlineicon + text, parts inside one control, chip or row0.375rem0.25rem
gap-itemssiblings in a list or stack: cards, chips, buttons, form fields0.5rem0.375rem
gap-groupgroups inside a surface: header vs body, dialog sections1rem0.75rem
gap-sectionsurfaces on a page: board columns, stat cards, a page's blocks1.5rem1rem
px-inset-chip / py-inset-chippills, badges, chips, kbd0.5rem / 0.125rem0.375rem / 0.125rem
px-inset-item / py-inset-itemmenu and list items, small cards, table cells0.625rem / 0.5rem0.5rem / 0.375rem
px-control-xbuttons, inputs, selects0.875rem0.625rem
p-inset-surfacecards, dialogs, panels, popovers1.5rem1rem
p-control-insetthe rim of a control-height bar around -sm items2px2px
  • A component never sets outer margin: the parent spaces its children with gap.
  • Sizes (h-control, size-control-sm) are not spacing; prefer the size tokens.

Typography

Each step sets size and line height, and the meta, title and display steps a weight. Caption, body-sm and body keep the weight they inherit, so a <strong> or <th> stays bold.

UtilityRoleSize / line / weight
text-metaeyebrows, kickers, overlines (with tracking-meta)11/14/500
text-captionhints, timestamps, table footnotes12/16
text-body-smsecondary text, descriptions in dense UI13/18
text-bodydefault UI and reading text14/20
text-title-smcard, panel and list-group titles15/20/600
text-titledialog, drawer and section titles18/24/600
text-display-smpage titles, stat values24/28/650
text-displayhero numbers, empty-state headlines28/32/700

Elevation

In-page surfaces (cards, board columns, panels) use shadow-surface and rounded-surface. Anything that floats above the page uses surface-floating: popovers, menus, select lists, hover cards and toasts. Dialogs and drawers take the floating shadow, border and radius but stay opaque reading surfaces in every theme.

shadow-surface
surface-floating

Layers and motion

UtilityValueRole
z-sticky20sticky headers, a Floating bar
z-overlay40dialog and drawer backdrops and content
z-popover50popovers, menus, list popups, tooltips
z-toast60the toast region, above everything else
duration-micro140mshover and press feedback, popovers, menus, tooltips
duration-panel180mspanels that resize or slide: accordion, sidebar, toasts
duration-dialog200msdialogs and their backdrop
ease-standardcubic-bezier(0.2, 0, 0, 1)every token-timed transition

prefers-reduced-motion: reduce collapses every transition and animation in the base layer; components add motion-reduce: only to swap a movement for a fade.

Touch targets

On a coarse pointer, controls reach a 44px hit area without changing how they look on a desktop: the touch-target class adds a centred ::before to buttons, toggles, tabs, checkboxes, radios and switches. Rows that stack closer grow with pointer-coarse: instead.

The narrow breakpoint

narrow: applies at 760px and below. Write the wide layout first and override it: flex-row narrow:flex-col. It's about the viewport, not density; prefer container queries for a component that lives in panels of different widths. Colours are on the Tone and colour page.