Theming Token reference
Token reference
The 50-token --pretable-* surface, with shape, default, and purpose for each.
Pretable's public theming surface is 50 CSS variables, all --pretable-* prefixed. Each theme defines all 50 at :root. Three themes ship preset values — pretable, the house theme and the documented default, plus the Excel and Material 3 compatibility skins. Consumers override individual tokens at :root in their own stylesheet (see Override tokens).
Three tokens —
--pretable-row-height,--pretable-header-height, and--pretable-group-panel-height— are read by the engine in JavaScript, because it needs them as numbers to lay out rows, the sticky header, and the group panel. The other 47 are CSS-only. The engine resolves the three against the grid's own element, so they inherit from wherever you set them —:root, or a wrapper — like every other token. Of the three, the first two are also readable from your own code viagetDensityHeightsin@pretable/ui, which takes the element to resolve against.
Surfaces (7)
| Token | Description | Type | pretable (default) | Excel | Material 3 (light) |
|---|---|---|---|---|---|
--pretable-bg-grid | Body cell background | color | #ffffff | #ffffff | #fcfcfc (N99) |
--pretable-bg-grid-alt | Alternate (zebra) row background | color | #ffffff | #ffffff | #fcfcfc |
--pretable-bg-pinned | Pinned (frozen) body cell background | color | #ffffff | var(--pretable-bg-header) | var(--pretable-bg-header) |
--pretable-bg-group-row | Group header row background | color | #f7f7f9 | var(--pretable-bg-header) | var(--pretable-bg-header) |
--pretable-bg-header | Header row background | color | #eff0f4 | #f3f3f3 | #f3f3f3 (N96) |
--pretable-bg-toolbar | Toolbar + status/pagination bar background | color | #f1f1f4 | #f3f3f3 | #f3f3f3 |
--pretable-bg-tooltip | Tooltip / column menu / filter popover background | color | #ffffff | #ffffff | #f3f3f3 |
Set
--pretable-bg-grid-altequal to--pretable-bg-gridwhen you do not want zebra striping; all three themes do.
Pinned body cells and group rows used to borrow
--pretable-bg-header, which made it impossible to restyle a frozen data column without also restyling the header. They now have their own tokens. Excel and Material alias both back to the header value, so neither skin changes appearance; thepretabletheme keeps pinned cells the same white as the rest of the data, because a pinned column is data rather than chrome, and marks the frozen edge with--pretable-seam-colorinstead.
Text (3)
| Token | Description | Type | pretable (default) | Excel | Material 3 (light) |
|---|---|---|---|---|---|
--pretable-text-cell | Body cell text color | color | #1a1a1f | #1f1f1f | #1c1c1c (on-surface) |
--pretable-text-header | Header text color | color | #5e5e6a | #5c5c5c | #49494c (on-surface-variant) |
--pretable-text-dim | Secondary text (toolbar labels, empty-state body, status text) | color | #52525c | #5c5c5c | #49494c |
Lines and radii (6)
| Token | Description | Type | pretable (default) | Excel | Material 3 (light) |
|---|---|---|---|---|---|
--pretable-rule | Horizontal rule color — the hairline between rows | color | #dfdfe5 | #d4d4d4 | #cccccc (outline-variant) |
--pretable-rule-vertical | Vertical rule color — the divider between columns | color | transparent | var(--pretable-rule) | var(--pretable-rule) |
--pretable-rule-width | Width of both per-cell rules | length | 1px | 1px | 1px |
--pretable-rule-strong | Container outer edge + header bottom border | color | #7e7e8b | #a6a6a6 | #797979 (outline) |
--pretable-radius | Container border radius | length | 10px | 0 | 12px (M3 medium shape) |
--pretable-radius-control | Radius for small affordances | length | 6px | 0 | 6px (M3 small shape) |
--pretable-ruleused to color both axes, so no theme could drop the column cage without also losing row separation. Splitting the vertical divider into its own token makes the two independent: Excel and Material alias vertical back to--pretable-ruleand keep the full cage, while thepretabletheme sets it totransparentfor horizontal-only separation.
--pretable-rule-widthgoverns only the per-cell row and column dividers. Frame, popover, menu, and editor borders stay1pxregardless.
--pretable-radiusis the container radius, and applying it to a 14–18px control rounds that control into a circle.--pretable-radius-controlis the separate, smaller step those affordances take: menu items, the funnel and ⋮ buttons, and the chip remove target.
State (4)
| Token | Description | Type | pretable (default) | Excel | Material 3 (light) |
|---|---|---|---|---|---|
--pretable-bg-hover | Row hover background | color | rgba(24, 24, 32, 0.05) | transparent (no hover) | rgba(28, 28, 28, 0.08) (on-surface @ 8%) |
--pretable-bg-selected | Selected-option background (enum + date editors) | color | #dfe6fb | rgba(16, 124, 65, 0.10) | #d1e4ff (secondary-container) |
--pretable-text-selected | Selected cell text, and selected-option text | color | #131826 | #1f1f1f | #001d36 (on-secondary-container) |
--pretable-focus-ring | Focus outline color (cell focus, kbd nav) | color | #2554cf | #107c41 (Excel green) | #0061a4 (primary) |
--pretable-bg-selecteddoes not fill a selected cell, despite the name. The grid stylesheet reads it in exactly two places, both of them a highlighted option in a cell editor: the enum listbox and the date picker's day. The fill behind a selected cell or range is--pretable-selection-bg, in Grid controls below — it is a translucent tint, drawn as a background layer so a pinned cell keeps its opaque fill underneath.--pretable-text-selectedis the one of the pair that does span both: it colors selected cell text as well as those two options.
Editing (2)
These tokens skin the inline cell editor (see Editing).
| Token | Description | Type | pretable (default) | Excel | Material 3 (light) |
|---|---|---|---|---|---|
--pretable-edit-bg | Editor field surface | color | #f7f7fa | #ffffff | #fcfcfc (N99) |
--pretable-text-error | Invalid-input outline + inline error-message text | color | #c0271c | #b91c1c | #b3261e (error) |
Accent (1)
| Token | Description | Type | pretable (default) | Excel | Material 3 (light) |
|---|---|---|---|---|---|
--pretable-accent | Active filter funnel, filter menu Clear button, date-picker nav on hover | color | #3f5a7a | #107c41 | #0061a4 (primary) |
The accent's direct reach is exactly those three marks — it is what the grid stylesheet reads
--pretable-accentfor, and nothing else. In particular it does not paint the sort indicator (the caret is drawn incurrentColor, so it inherits--pretable-text-header, and the multi-sort priority badge takes--pretable-text-dim), the focus ring (--pretable-focus-ring), or the column drop indicator (--pretable-reorder-drop-indicator). Each of those owns its own token, and under thepretabletheme in light mode the latter two are a literal#2554cf— a different, more saturated blue than the#3f5a7aaccent. (Its dark block moves both to#8ab0ff, and the accent to#8fb2d9; the separation is the point, not the specific hex.) The two compatibility skins alias their control tokens back to the accent, so one override travels further there than it does underpretable; see Override tokens.
Semantic ramp (4)
These four are the ramp the delta, status, and badge cell presentations read — [data-pretable-delta], [data-pretable-status], and [data-pretable-badge][data-pretable-tone]. They carry meaning rather than decoration: a signed delta's direction, a status dot's state. Nothing here paints a surface or chrome, and all three themes ship the same light values.
The values were re-derived rather than taken from any reference palette, because the obvious hues fail WCAG AA at text sizes. Contrast is a property of the pair, so the ground matters: the light themes ship two, #ffffff under pretable and Excel and #fcfcfc under Material. A #16a34a green measures 3.30:1 on white and 3.21:1 on Material's ground; a #d97706 amber, 3.19:1 and 3.11:1. All four are under the 4.5 floor, and the choice of ground is not what saves them. They look fine in reference screenshots only because they sit inside chips and bold glyphs rather than 14px text. The shipped light values clear the floor on both grounds — 4.83–5.17 on white, 4.71–5.04 on #fcfcfc — and are held that close together on purpose, so that no one color reads as more urgent than its neighbours purely because its hue is darker.
| Token | Description | Type | pretable (default) | Excel | Material 3 (light) |
|---|---|---|---|---|---|
--pretable-positive | Upward delta, positive status dot, positive badge | color | #15803d | #15803d | #15803d |
--pretable-negative | Downward delta, negative status dot, negative badge | color | #dc2626 | #dc2626 | #dc2626 |
--pretable-warning | Warning status dot, warning badge | color | #a16207 | #a16207 | #a16207 |
--pretable-info | Informational status dot, informational badge | color | #2563eb | #2563eb | #2563eb |
Elevation (3)
The scale is named for what is lifted, not for the one control that happened to need a shadow first. --pretable-shadow-overlay is the shadow on everything that leaves the plane: the filter menu, the column menu, the enum listbox, the date popover, and the column drag ghost.
| Token | Description | Type | pretable (default) | Excel | Material 3 (light) |
|---|---|---|---|---|---|
--pretable-shadow-overlay | Popovers, menus, and the drag ghost | shadow | 0 1px 2px rgba(16, 17, 26, 0.06), 0 8px 24px -6px rgba(16, 17, 26, 0.16) | 0 4px 12px rgb(0 0 0 / 0.12) | 0 4px 12px rgb(0 0 0 / 0.12) |
--pretable-shadow-card | Container elevation | shadow | 0 1px 2px rgba(16, 17, 26, 0.05), 0 2px 8px -4px rgba(16, 17, 26, 0.1) | none | none |
--pretable-seam-color | Color of the frozen-column edge | color | rgba(16, 17, 26, 0.2) | transparent | transparent |
Renamed.
--pretable-shadow-overlayused to be named for the drag ghost:reorder-ghost-shadow, carrying the usual--pretable-prefix. Four of its five uses are popovers rather than drag ghosts, so the old name described the least representative one. That name no longer resolves to anything — if your stylesheet still sets it, rename it to--pretable-shadow-overlay.
--pretable-shadow-cardlets a theme separate the grid from the host page with elevation instead of a drawn frame. Both compatibility skins set it tononeand draw the frame instead; thepretabletheme uses a hairline plus real elevation.
--pretable-seam-coloris a color, not a whole shadow, because the right-hand frozen edge needs the mirror of the left one's offset and a singlebox-shadowvalue cannot be flipped. The grid stylesheet owns that geometry; the theme owns the strength. Both compatibility skins opt out withtransparent, since each already marks the frozen edge with a tone step on--pretable-bg-pinnedplus a vertical rule.
Density (8)
The first three are read by the engine in JavaScript; the other five are CSS-only.
| Token | Description | Type | pretable (standard) | Excel (compact) | Material 3 (standard) |
|---|---|---|---|---|---|
--pretable-row-height | Body row height | length | 48px | 20px | 48px |
--pretable-header-height | Header row height | length | 52px | 24px | 52px |
--pretable-group-panel-height | Drag-to-group strip above the header | length | 44px | 28px | 44px |
--pretable-cell-padding-x | Body cell horizontal padding | length | 16px | 6px | 16px |
--pretable-cell-padding-y | Body cell vertical padding | length | 12px | 2px | 12px |
--pretable-font-size-cell | Body cell font size | length | 14px | 15px | 14px |
--pretable-font-size-header | Header font size | length | 12.5px | 13px | 14px |
--pretable-group-indent | Indent added per grouping level | length | 24px | 12px | 24px |
Density tokens vary by tier. The values shown above are each theme's natural default (
:root) — standard forpretableand Material, compact for Excel. When[data-density="..."]is set on<html>— or on any wrapper element — the corresponding override block adjusts these tokens — see Density switching.
--pretable-group-indentis the step, not the total: a row at depth n is indented n × the token, applied as padding inside the group cell so that a pinned group column keeps its indent when the grid scrolls. Both group header rows and their leaf rows read it, which is what keeps the two columns of text aligned. It is the one density token the grid stylesheet reads with a literal fallback —var(--pretable-group-indent, 16px)— so a theme written before the token existed still renders a visible hierarchy instead of collapsing grouped rows into a flat list.--pretable-icon-sizeis read the same way, for the same reason.
Icons (1)
| Token | Description | Type | pretable (default) | Excel | Material 3 (light) |
|---|---|---|---|---|---|
--pretable-icon-size | Draw size of every glyph in the built-in icon set | length | 14px | 12px | 16px |
Deliberately not density-scoped: the chrome glyphs are affordances rather than text, so they hold one size across every tier. Each theme picks a size that sits correctly beside its own header text — 12px under Excel's dense 13px header, 16px under Material's 14px one.
Typography (2)
| Token | Description | Type | pretable (default) | Excel | Material 3 |
|---|---|---|---|---|---|
--pretable-font-sans | Primary sans-serif family stack | font | ui-sans-serif, system-ui, … | "Aptos Narrow", "Aptos", … | "Roboto Flex", "Roboto", … |
--pretable-font-mono | Monospace family stack (numeric cells, code) | font | ui-monospace, SFMono-Regular, … | ui-monospace, "Cascadia Mono", … | "Roboto Mono", ui-monospace, … |
The stacks are elided above; each theme declares its full list at
:rootinpackages/ui/themes/<theme>.css.
The
pretabletheme ships no webfont on purpose: a house theme that carries a font dependency cannot disappear into a host application, and it costs a network request before first paint. The stack resolves to whatever the platform already renders its UI in.
Grid controls (9)
These tokens control the visual appearance of interactive grid elements: row-selection checkboxes, cell-range selection overlays, column resize handles, and column reorder drag-and-drop indicators. In the two compatibility skins seven of the nine derive from --pretable-accent, --pretable-bg-grid, --pretable-rule-strong, and --pretable-bg-header, so overriding those upstream tokens recolors the controls coherently. The remaining two are literal in those skins: --pretable-checkbox-checked-fg is a flat #fff, so recoloring the accent moves the checked box out from under a checkmark that stays white and you must override the checkmark yourself; and --pretable-resize-handle is transparent — the idle handle is deliberately invisible, so there is no color there to keep in step with anything. The pretable theme writes all nine as literals, so that its dark block can move an affordance independently of the decorative token it would otherwise have inherited. The drag ghost's shadow is no longer here — it comes from --pretable-shadow-overlay, in Elevation above.
| Token | Description | Type | pretable (default) | Excel | Material 3 (light) |
|---|---|---|---|---|---|
--pretable-selection-bg | Range-selection overlay background | color | rgba(37, 84, 207, 0.1) | color-mix(in srgb, var(--pretable-accent) 8%, transparent) | color-mix(in srgb, var(--pretable-accent) 8%, transparent) |
--pretable-checkbox-bg | Row-select checkbox background | color | #ffffff | var(--pretable-bg-grid) | var(--pretable-bg-grid) |
--pretable-checkbox-border | Row-select checkbox border | color | #787885 | var(--pretable-rule-strong) | var(--pretable-rule-strong) |
--pretable-checkbox-checked-bg | Row-select checkbox background when checked | color | #2554cf | var(--pretable-accent) | var(--pretable-accent) |
--pretable-checkbox-checked-fg | Row-select checkmark color | color | #ffffff | #fff | #fff |
--pretable-resize-handle | Column resize handle (idle) | color | transparent | transparent | transparent |
--pretable-resize-handle-hover | Column resize handle (hover/dragging) | color | #2554cf | var(--pretable-accent) | var(--pretable-accent) |
--pretable-reorder-ghost-bg | Column drag ghost background | color | #ffffff | var(--pretable-bg-header) | var(--pretable-bg-header) |
--pretable-reorder-drop-indicator | Column drop-position indicator | color | #2554cf | var(--pretable-accent) | var(--pretable-accent) |
The checkmark is the one to watch in dark mode.
--pretable-checkbox-checked-fghas to stay legible against--pretable-checkbox-checked-bg, and a dark theme that lightens the checked box without touching the checkmark leaves white ink on a pale chip. Both dark themes restate it:pretableuses#10131con its#8ab0ffbox, and Material uses#003258— M3's darkon-primary— on its#9ecaffone, 7.73:1. Material shipped without that line for a while and drew white on light blue at 1.70:1, which is what the CI contrast check on this pair now exists to prevent. Excel is light-only, so the case never arises there. If you author a dark variant, restate this token; see Light and dark.
Stability
@pretable/ui is pre-1.0. Token names may be renamed or removed in any release, so this page is the list as of the version you have installed rather than a promise about the next one — each release's CHANGELOG.md describes the deltas. Override at your own risk; the contract solidifies at 1.0.
Where to go next
- Override tokens — recipes for changing values.
- Theming Overview — the architectural model.
- Custom themes — author your own theme file.