All Tokens
Complete reference for spacing, color, radius, typography, shadow, motion, and size tokens.Color Tokens #
Semantic colors for consistent theming. All colors use light-dark() for automatic mode switching.
| Token | Value |
|---|---|
| --color-accent | |
| --color-accent-muted | |
| --color-on-accent | |
| --color-neutral | |
| --color-background-surface | |
| --color-background-body | |
| --color-overlay | |
| --color-overlay-hover | |
| --color-overlay-pressed | |
| --color-background-muted | |
| --color-text-primary | |
| --color-text-secondary | |
| --color-text-disabled | |
| --color-text-accent | |
| --color-on-dark | |
| --color-on-light | |
| --color-icon-accent | |
| --color-icon-primary | |
| --color-icon-secondary | |
| --color-icon-disabled | |
| --color-background-card | |
| --color-background-popover | |
| --color-background-inverted | |
| --color-background-error-inverted | |
| --color-success | |
| --color-success-muted | |
| --color-on-success | |
| --color-error | |
| --color-error-muted | |
| --color-on-error | |
| --color-warning | |
| --color-warning-muted | |
| --color-on-warning | |
| --color-border | |
| --color-border-emphasized | |
| --color-skeleton | |
| --color-track | |
| --color-shadow | |
| --color-tint-hover | |
| --color-background-blue | |
| --color-border-blue | |
| --color-icon-blue | |
| --color-text-blue | |
| --color-background-cyan | |
| --color-border-cyan | |
| --color-icon-cyan | |
| --color-text-cyan | |
| --color-background-gray | |
| --color-border-gray | |
| --color-icon-gray | |
| --color-text-gray | |
| --color-background-green | |
| --color-border-green | |
| --color-icon-green | |
| --color-text-green | |
| --color-background-orange | |
| --color-border-orange | |
| --color-icon-orange | |
| --color-text-orange | |
| --color-background-pink | |
| --color-border-pink | |
| --color-icon-pink | |
| --color-text-pink | |
| --color-background-purple | |
| --color-border-purple | |
| --color-icon-purple | |
| --color-text-purple | |
| --color-background-red | |
| --color-border-red | |
| --color-icon-red | |
| --color-text-red | |
| --color-background-teal | |
| --color-border-teal | |
| --color-icon-teal | |
| --color-text-teal | |
| --color-background-yellow | |
| --color-border-yellow | |
| --color-icon-yellow | |
| --color-text-yellow |
Spacing Tokens #
Spacing scale used for padding, gap, and margin. Component gap props map spacing steps to these tokens.
| Token | Value |
|---|---|
| --spacing-0 | 0px |
| --spacing-0-5 | 2px |
| --spacing-1 | 4px |
| --spacing-1-5 | 6px |
| --spacing-2 | 8px |
| --spacing-3 | 12px |
| --spacing-4 | 16px |
| --spacing-5 | 20px |
| --spacing-6 | 24px |
| --spacing-7 | 28px |
| --spacing-8 | 32px |
| --spacing-9 | 36px |
| --spacing-10 | 40px |
| --spacing-11 | 44px |
| --spacing-12 | 48px |
Size Tokens #
Control heights for consistent sizing across buttons, inputs, and selectors.
| Token | Value |
|---|---|
| --size-element-sm | 28px |
| --size-element-md | 32px |
| --size-element-lg | 36px |
Border Tokens #
Border width for card and input borders.
| Token | Value | Example |
|---|---|---|
| --border-width | 1px |
Radius Tokens #
Numeric scale based on a 4dp base unit. Tokens scale with the theme's radius multiplier; --radius-none and --radius-full are fixed.
| Token | Value | Example |
|---|---|---|
| --radius-none | 0px | |
| --radius-inner | 4px | |
| --radius-element | 8px | |
| --radius-container | 12px | |
| --radius-page | 28px | |
| --radius-chat | 28px | |
| --radius-full | 9999px |
Shadow Tokens #
Elevation shadows (low to med to high) and inset shadows for input state rings.
| Token | Preview |
|---|---|
| --shadow-low | |
| --shadow-med | |
| --shadow-high | |
| --shadow-inset-hover | |
| --shadow-inset-selected | |
| --shadow-inset-success | |
| --shadow-inset-warning | |
| --shadow-inset-error |
Duration Tokens #
Motion duration primitives. Three bands: fast (micro-interactions), medium (entrance/exit), slow (continuous). Min/max variants derive from base × ratio.
| Token | Value |
|---|---|
| --duration-fast-min | 130ms |
| --duration-fast | 175ms |
| --duration-fast-max | 230ms |
| --duration-medium-min | 310ms |
| --duration-medium | 410ms |
| --duration-medium-max | 550ms |
| --duration-slow-min | 730ms |
| --duration-slow | 975ms |
| --duration-slow-max | 1300ms |
Easing Tokens #
Easing curves for animations and transitions.
| Token | Value |
|---|---|
| --ease-standard |
Font Family Tokens #
Font family stacks for body, code, and heading text.
| Token | Value | Example |
|---|---|---|
| --font-family-body | -apple-system | The quick brown fox jumps over the lazy dog |
| --font-family-code | "SF Mono" | The quick brown fox jumps over the lazy dog |
| --font-family-heading | -apple-system | The quick brown fox jumps over the lazy dog |
Font Size Tokens #
Geometric type scale: round(14 × 1.2^step). Base is 14px (--font-size-base).
| Token | Value | Example |
|---|---|---|
| --font-size-4xs | 0.375rem | The quick brown fox jumps over the lazy dog |
| --font-size-3xs | 0.4375rem | The quick brown fox jumps over the lazy dog |
| --font-size-2xs | 0.5rem | The quick brown fox jumps over the lazy dog |
| --font-size-xs | 0.625rem | The quick brown fox jumps over the lazy dog |
| --font-size-sm | 0.75rem | The quick brown fox jumps over the lazy dog |
| --font-size-base | 0.875rem | The quick brown fox jumps over the lazy dog |
| --font-size-lg | 1.0625rem | The quick brown fox jumps over the lazy dog |
| --font-size-xl | 1.25rem | The quick brown fox jumps over the lazy dog |
| --font-size-2xl | 1.5rem | The quick brown fox jumps over the lazy dog |
| --font-size-3xl | 1.8125rem | The quick brown fox jumps over the lazy dog |
| --font-size-4xl | 2.1875rem | The quick brown fox jumps over the lazy dog |
| --font-size-5xl | 2.625rem | The quick brown fox jumps over the lazy dog |
Font Weight Tokens #
Font weight values for body, emphasis, and headings.
| Token | Value | Example |
|---|---|---|
| --font-weight-normal | 400 | The quick brown fox jumps over the lazy dog |
| --font-weight-medium | 500 | The quick brown fox jumps over the lazy dog |
| --font-weight-semibold | 600 | The quick brown fox jumps over the lazy dog |
| --font-weight-bold | 700 | The quick brown fox jumps over the lazy dog |
Type Scale Tokens #
Semantic tokens for headings, body, labels, code, supporting text, and display text. References font size and weight tokens. Override via typography.scale in defineTheme.
| Sample | Tokens |
|---|---|
| H1 | 1.5rem · Figtree 600 · 1.3333 (32px) |
| H2 | 1.25rem · Figtree 600 · 1.4 (28px) |
| H3 | 1.0625rem · Figtree 600 · 1.4118 (24px) |
| H4 | 0.875rem · Figtree 600 · 1.4286 (20px) |
| H5 | 0.75rem · Figtree 600 · 1.6667 (20px) |
| H6 | 0.625rem · Figtree 600 · 1.6 (16px) |
| Display 1 | 2.625rem · Figtree 600 · 1.2381 (52px) |
| Display 2 | 2.1875rem · Figtree 600 · 1.2571 (44px) |
| Display 3 | 1.8125rem · Figtree 600 · 1.2414 (36px) |
| Large | 1.0625rem · Figtree 600 · 1.4118 (24px) |
| Body | 0.875rem · Figtree 400 · 1.4286 (20px) |
| Label | 0.875rem · Figtree 500 · 1.4286 (20px) |
| Code | 0.875rem · "SF Mono" 400 · 1.4286 (20px) |
| Supporting | 0.75rem · Figtree 400 · 1.6667 (20px) |
Usage in StyleX #
tsimport * as stylex from '@stylexjs/stylex';// Token names are the public surface; the `defineVars` objects that mint them// are internal to @astryx-svelte/core, so reference them as var() strings.export const styles = stylex.create({card: {padding: 'var(--spacing-4)',backgroundColor: 'var(--color-background-surface)',borderRadius: 'var(--radius-container)'},button: {height: 'var(--size-element-md)'}});
svelte<script lang="ts">import { Card } from '@astryx-svelte/core';import { styles } from './page.stylex.js';</script><Card xstyle={styles.card}>Tokens applied via xstyle</Card>
StyleX may only be imported from a .ts module, never from a .svelte file — the bundler plugin Babel-parses anything that imports @stylexjs/stylex and would read Svelte markup as JSX. Author styles in a sibling .stylex.ts and pass them in as xstyle.
For a non-StyleX styling library, tokenVar() / tokenVars from @astryx-svelte/core/theme return the same var(--token) references as typed values. See astryx-svelte docs styling for how to apply tokens via xstyle, class, and compound component patterns, and astryx-svelte docs theme for overriding tokens with defineTheme.