Theming Token reference

Token reference

The 36-token --pretable-* surface, with shape, default, and purpose for each.

Pretable's public theming surface is 36 CSS variables, all --pretable-* prefixed. Each theme defines all 36 at :root. Excel and Material 3 ship preset values; consumers override individual tokens at :root in their own stylesheet (see Override tokens).

Two tokens — --pretable-row-height and --pretable-header-height — are read by the engine in JavaScript via the useResolvedHeights hook. The other 34 are CSS-only.

Surfaces (5)

TokenDescriptionTypeExcelMaterial 3 (light)
--pretable-bg-gridBody cell backgroundcolor#ffffff#fef7ff (surface)
--pretable-bg-grid-altAlternate (zebra) row background; equal to bg-grid if no zebra desiredcolor#ffffff#fef7ff
--pretable-bg-headerHeader row background; pinned cells reuse thiscolor#f3f3f3#f3edf7 (surface-container)
--pretable-bg-toolbarToolbar + status/pagination bar backgroundcolor#f3f3f3#f3edf7
--pretable-bg-tooltipTooltip / column menu / filter popover backgroundcolor#ffffff#f3edf7

Text (3)

TokenDescriptionTypeExcelMaterial 3 (light)
--pretable-text-cellBody cell text colorcolor#1f1f1f#1d1b20 (on-surface)
--pretable-text-headerHeader text colorcolor#5c5c5c#49454f (on-surface-variant)
--pretable-text-dimSecondary text (toolbar labels, empty-state body, status text)color#5c5c5c#49454f

Lines (3)

TokenDescriptionTypeExcelMaterial 3 (light)
--pretable-ruleGridline color (between cells)color#d4d4d4#cac4d0 (outline-variant)
--pretable-rule-strongContainer outer edge + header bottom bordercolor#a6a6a6#79747e (outline)
--pretable-radiusContainer border radiuslength012px (M3 medium shape scale)

State (4)

TokenDescriptionTypeExcelMaterial 3 (light)
--pretable-bg-hoverRow hover backgroundcolortransparent (no hover)rgba(29, 27, 32, 0.08) (on-surface @ 8%)
--pretable-bg-selectedSelected cell/row backgroundcolorrgba(16, 124, 65, 0.10)#e8def8 (secondary-container)
--pretable-text-selectedSelected cell/row text colorcolor#1f1f1f#1d192b (on-secondary-container)
--pretable-focus-ringFocus outline color (cell focus, kbd nav)color#107c41 (Excel green)#6750a4 (primary)

Editing (2)

These tokens skin the inline cell editor (see Editing).

TokenDescriptionTypeExcelMaterial 3 (light)
--pretable-edit-bgEditor field surface (matches the grid background)color#ffffff#fcfcfc (N99)
--pretable-text-errorInvalid-input outline + inline error-message textcolor#b91c1c#b3261e (error)

Accent (1)

TokenDescriptionTypeExcelMaterial 3 (light)
--pretable-accentSort indicator, active filter tag, focus highlights, drag indicatorscolor#107c41#6750a4 (primary)

Density (6)

The first two are read by the engine in JavaScript. The other four are CSS-only.

TokenDescriptionTypeExcelMaterial 3 (standard)Engine reads?
--pretable-row-heightBody row heightlength20px48pxyes
--pretable-header-heightHeader row heightlength24px52pxyes
--pretable-cell-padding-xBody cell horizontal paddinglength6px16px
--pretable-cell-padding-yBody cell vertical paddinglength2px12px
--pretable-font-size-cellBody cell font sizelength15px14px
--pretable-font-size-headerHeader font sizelength13px14px

Density tokens vary by tier. The values shown above are each theme's natural default (:root). When [data-density="..."] is set on <html>, the corresponding override block adjusts these tokens — see Density switching.

Typography (2)

TokenDescriptionTypeExcelMaterial 3
--pretable-font-sansPrimary sans-serif family stackfont"Aptos Narrow", "Aptos", "Segoe UI", -apple-system, …"Roboto Flex", "Roboto", system-ui, …
--pretable-font-monoMonospace family stack (numeric cells, code)fontui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace"Roboto Mono", ui-monospace, monospace

Grid controls (10)

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. Most derive from the theme's --pretable-accent, --pretable-bg-grid, --pretable-rule-strong, and --pretable-bg-header, so overriding those upstream tokens recolors the controls coherently; --pretable-checkbox-checked-fg and --pretable-reorder-ghost-shadow are standalone constants (#fff and a box-shadow value) that you must override explicitly if needed.

TokenDescriptionTypeExcelMaterial 3 (light)
--pretable-selection-bgRange-selection overlay background ([aria-selected] cells)colorcolor-mix(in srgb, var(--pretable-accent) 8%, transparent)color-mix(in srgb, var(--pretable-accent) 8%, transparent)
--pretable-checkbox-bgRow-select checkbox backgroundcolorvar(--pretable-bg-grid)var(--pretable-bg-grid)
--pretable-checkbox-borderRow-select checkbox bordercolorvar(--pretable-rule-strong)var(--pretable-rule-strong)
--pretable-checkbox-checked-bgRow-select checkbox background when checkedcolorvar(--pretable-accent)var(--pretable-accent)
--pretable-checkbox-checked-fgRow-select checkmark colorcolor#fff#fff
--pretable-resize-handleColumn resize handle (idle)colortransparenttransparent
--pretable-resize-handle-hoverColumn resize handle (hover/dragging)colorvar(--pretable-accent)var(--pretable-accent)
--pretable-reorder-ghost-bgColumn drag ghost backgroundcolorvar(--pretable-bg-header)var(--pretable-bg-header)
--pretable-reorder-ghost-shadowColumn drag ghost shadowshadow0 4px 12px rgb(0 0 0 / 0.12)0 4px 12px rgb(0 0 0 / 0.12)
--pretable-reorder-drop-indicatorColumn drop-position indicatorcolorvar(--pretable-accent)var(--pretable-accent)

Stability

@pretable/ui is at version 0.0.x. Token names may rename or remove in any patch release. Each release's CHANGELOG.md describes the deltas. Override at your own risk; the contract solidifies post-1.0.

Where to go next