Skip to main content

ferro_theme/
token.rs

1//! Fixed semantic token vocabulary for ferro-theme/v1.
2//!
3//! Defines ~23 semantic slots that every theme must provide. Tokens are
4//! CSS custom properties resolved by the Tailwind v4 `@theme` directive.
5//! Components reference them as utility classes (`bg-primary`, `text-surface`, etc.).
6
7// Surface tokens — structural background hierarchy
8/// Background of the page.
9pub const TOKEN_BACKGROUND: &str = "--color-background";
10/// Raised surface above background (panels, sidebars).
11pub const TOKEN_SURFACE: &str = "--color-surface";
12/// Card background (further raised above surface).
13pub const TOKEN_CARD: &str = "--color-card";
14/// Default border color.
15pub const TOKEN_BORDER: &str = "--color-border";
16/// Primary text color.
17pub const TOKEN_TEXT: &str = "--color-text";
18/// Muted/secondary text color.
19pub const TOKEN_TEXT_MUTED: &str = "--color-text-muted";
20
21// Role tokens — semantic color roles
22/// Primary action color (buttons, links, highlights).
23pub const TOKEN_PRIMARY: &str = "--color-primary";
24/// Foreground color on primary backgrounds.
25pub const TOKEN_PRIMARY_FOREGROUND: &str = "--color-primary-foreground";
26/// Secondary action color.
27pub const TOKEN_SECONDARY: &str = "--color-secondary";
28/// Foreground color on secondary backgrounds.
29pub const TOKEN_SECONDARY_FOREGROUND: &str = "--color-secondary-foreground";
30/// Accent color for decorative highlights.
31pub const TOKEN_ACCENT: &str = "--color-accent";
32/// Destructive / danger actions.
33pub const TOKEN_DESTRUCTIVE: &str = "--color-destructive";
34/// Success / confirmation state.
35pub const TOKEN_SUCCESS: &str = "--color-success";
36/// Warning / caution state.
37pub const TOKEN_WARNING: &str = "--color-warning";
38
39// Shape tokens — border radius scale
40/// Extra-small border radius.
41pub const TOKEN_RADIUS_SM: &str = "--radius-sm";
42/// Medium border radius (default for most elements).
43pub const TOKEN_RADIUS_MD: &str = "--radius-md";
44/// Large border radius (cards, modals).
45pub const TOKEN_RADIUS_LG: &str = "--radius-lg";
46/// Full (pill) border radius.
47pub const TOKEN_RADIUS_FULL: &str = "--radius-full";
48
49// Shadow tokens — elevation scale
50/// Subtle shadow (inputs, small cards).
51pub const TOKEN_SHADOW_SM: &str = "--shadow-sm";
52/// Medium shadow (floating panels).
53pub const TOKEN_SHADOW_MD: &str = "--shadow-md";
54/// Large shadow (modals, popovers).
55pub const TOKEN_SHADOW_LG: &str = "--shadow-lg";
56
57// Typography tokens — font family scale only; Tailwind size scale stays as-is
58/// Sans-serif font stack.
59pub const TOKEN_FONT_SANS: &str = "--font-sans";
60/// Monospace font stack.
61pub const TOKEN_FONT_MONO: &str = "--font-mono";
62
63/// All token names in the ferro-theme/v1 vocabulary (23 slots).
64pub const ALL_TOKENS: &[&str] = &[
65    TOKEN_BACKGROUND,
66    TOKEN_SURFACE,
67    TOKEN_CARD,
68    TOKEN_BORDER,
69    TOKEN_TEXT,
70    TOKEN_TEXT_MUTED,
71    TOKEN_PRIMARY,
72    TOKEN_PRIMARY_FOREGROUND,
73    TOKEN_SECONDARY,
74    TOKEN_SECONDARY_FOREGROUND,
75    TOKEN_ACCENT,
76    TOKEN_DESTRUCTIVE,
77    TOKEN_SUCCESS,
78    TOKEN_WARNING,
79    TOKEN_RADIUS_SM,
80    TOKEN_RADIUS_MD,
81    TOKEN_RADIUS_LG,
82    TOKEN_RADIUS_FULL,
83    TOKEN_SHADOW_SM,
84    TOKEN_SHADOW_MD,
85    TOKEN_SHADOW_LG,
86    TOKEN_FONT_SANS,
87    TOKEN_FONT_MONO,
88];