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.

TokenValue
--color-accent
#0064E0 / #2694FE
--color-accent-muted
#0082FB33 / #0082FB3F
--color-on-accent
#FFFFFF
--color-neutral
rgba(5, 54, 89, 0.1) / rgba(223, 226, 229, 0.2)
--color-background-surface
#FFFFFF / #1F1F22
--color-background-body
#F1F4F7 / #111112
--color-overlay
#01122866 / #11111299
--color-overlay-hover
#0536590C / #FFFFFF0C
--color-overlay-pressed
#05365919 / #FFFFFF19
--color-background-muted
#0536590C / #1111127F
--color-text-primary
#0A1317 / #DFE2E5
--color-text-secondary
#4E606F / #AAAFB5
--color-text-disabled
#A4B0BC / #6F747C
--color-text-accent
#0064E0 / #3E9EFB
--color-on-dark
#FFFFFF
--color-on-light
#000000
--color-icon-accent
#0064E0 / #2694FE
--color-icon-primary
#0A1317 / #DFE2E5
--color-icon-secondary
#4E606F / #AAAFB5
--color-icon-disabled
#A4B0BC / #6F747C
--color-background-card
#FFFFFF / #1F1F22
--color-background-popover
#FFFFFF / #28292C
--color-background-inverted
#0A1317 / #FFFFFF
--color-background-error-inverted
#AA071E / #E3193B
--color-success
#0D8626
--color-success-muted
#0B991F33 / #0B991F3F
--color-on-success
#FFFFFF
--color-error
#E3193B / #F5394F
--color-error-muted
#E3193B33 / #F5394F3F
--color-on-error
#FFFFFF
--color-warning
#E9AF08 / #F2C00B
--color-warning-muted
#E2A40033 / #E2A4003F
--color-on-warning
#0A1317
--color-border
#05365919 / #F2F4F619
--color-border-emphasized
#CCD3DB / #494D53
--color-skeleton
#CCD3DB / #5A5E66
--color-track
#CCD3DB / #5A5E66
--color-shadow
rgba(5, 54, 89, 0.1) / rgba(0, 0, 0, 0.3)
--color-tint-hover
black / white
--color-background-blue
#0171E333
--color-border-blue
#0064E0 / #2694FE
--color-icon-blue
#0064E0 / #2694FE
--color-text-blue
#042F97 / #AFD7FF
--color-background-cyan
#03A7D733
--color-border-cyan
#089DD0 / #0171A4
--color-icon-cyan
#00ACC1 / #26C6DA
--color-text-cyan
#014975 / #A1EEF9
--color-background-gray
#0A131733 / #666A724C
--color-border-gray
#647685 / #748695
--color-icon-gray
#4E606F / #AAAFB5
--color-text-gray
#0A1317 / #E7EAED
--color-background-green
#24BB5E33
--color-border-green
#0D8626 / #0B991F
--color-icon-green
#0D8626 / #26A756
--color-text-green
#09441F / #A5F690
--color-background-orange
#F2790233
--color-border-orange
#EB6E00 / #B34A01
--color-icon-orange
#E9690B / #FB8C00
--color-text-orange
#6B2203 / #FDB876
--color-background-pink
#E638B333
--color-border-pink
#F351C0 / #C02294
--color-icon-pink
#C2185B / #EC407A
--color-text-pink
#650053 / #FEADE3
--color-background-purple
#7952FF33
--color-border-purple
#9081FF / #7340FE
--color-icon-purple
#5B08D8 / #7952FF
--color-text-purple
#3E0697 / #B3B0FE
--color-background-red
#E3193B33
--color-border-red
#E3193B / #F5394F
--color-icon-red
#D31130 / #E3193B
--color-text-red
#7B0210 / #FFB2B8
--color-background-teal
#0DB7AF33
--color-border-teal
#08A3A3 / #08767D
--color-icon-teal
#009688 / #26A69A
--color-text-teal
#083943 / #40DCCD
--color-background-yellow
#E2A40033
--color-border-yellow
#C58600 / #B47700
--color-icon-yellow
#FBC02D / #FFEE58
--color-text-yellow
#753F07 / #FBCE03

Spacing Tokens #

Spacing scale used for padding, gap, and margin. Component gap props map spacing steps to these tokens.

TokenValue
--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.

TokenValue
--size-element-sm
28px
--size-element-md
32px
--size-element-lg
36px

Border Tokens #

Border width for card and input borders.

TokenValueExample
--border-width1px

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.

TokenValueExample
--radius-none0px
--radius-inner4px
--radius-element8px
--radius-container12px
--radius-page28px
--radius-chat28px
--radius-full9999px

Shadow Tokens #

Elevation shadows (low to med to high) and inset shadows for input state rings.

TokenPreview
--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.

TokenValue
--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.

TokenValue
--ease-standard
cubic-bezier(0.24, 1, 0.4, 1)

Font Family Tokens #

Font family stacks for body, code, and heading text.

TokenValueExample
--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).

TokenValueExample
--font-size-4xs0.375rem The quick brown fox jumps over the lazy dog
--font-size-3xs0.4375rem The quick brown fox jumps over the lazy dog
--font-size-2xs0.5rem The quick brown fox jumps over the lazy dog
--font-size-xs0.625rem The quick brown fox jumps over the lazy dog
--font-size-sm0.75rem The quick brown fox jumps over the lazy dog
--font-size-base0.875rem The quick brown fox jumps over the lazy dog
--font-size-lg1.0625rem The quick brown fox jumps over the lazy dog
--font-size-xl1.25rem The quick brown fox jumps over the lazy dog
--font-size-2xl1.5rem The quick brown fox jumps over the lazy dog
--font-size-3xl1.8125rem The quick brown fox jumps over the lazy dog
--font-size-4xl2.1875rem The quick brown fox jumps over the lazy dog
--font-size-5xl2.625rem The quick brown fox jumps over the lazy dog

Font Weight Tokens #

Font weight values for body, emphasis, and headings.

TokenValueExample
--font-weight-normal400 The quick brown fox jumps over the lazy dog
--font-weight-medium500 The quick brown fox jumps over the lazy dog
--font-weight-semibold600 The quick brown fox jumps over the lazy dog
--font-weight-bold700 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.

SampleTokens
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 #

Tokens in a .stylex.ts module
ts
import * 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)'
}
});
Applying them to a component
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.