Semantic color tokens for backgrounds, text, borders, states, and emphasis. Built to support light and dark themes out of the box.

Prerequisites

Flexiwind color tokens are defined with CSS variables and consumed through Tailwind utilities. Ensure your main stylesheet (usually app.css ) is loaded globally, and load Flexiwind token definitions before custom overrides.

Avoid hardcoded hex values in components. Use semantic tokens so theme updates happen in one place.

Theme Modes

Choose one mode strategy based on product requirements. Most applications should start with both to support light and dark interfaces.

Mode Description
both
Define variables for both light and dark modes. Best default for applications with user theme switching.
light
Define only light mode variables. Use this when dark mode is intentionally not supported.
dark
Define only dark mode variables. Useful for dark-first products and internal tools.

Variable Tokens

Start from the mode that matches your project, then adjust only semantic token values. Keep token names stable to avoid breaking class usage in templates.

Theme Settings

Register color tokens in @theme so utilities are generated consistently. Once registered, use classes like bg-primary , text-fg , and border-border throughout your UI.

app.css
@theme inline {
    --font-sans: "Instrument Sans", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --radius-ui: var(--ui-radius);
    --radius-card: var(--card-radius);
    --radius-checkbox: var(--checkbox-radius); 
    

    --color-white: var(--color-white);
    --color-dark: var(--color-gray-950);

    --color-primary: var(--primary);
    --color-secondary: var(--secondary);
    --color-accent: var(--accent);
    --color-info: var(--info);
    --color-warning: var(--warning);
    --color-danger: var(--danger);
    --color-success: var(--success);

    --color-fg-title: var(--fg-title);
    --color-fg-subtitle: var(--fg-subtitle);
    --color-fg: var(--fg);
    --color-fg-muted: var(--fg-muted);

    --color-bg: var(--bg);
    --color-bg-subtle: var(--bg-subtle);
    --color-bg-surface: var(--bg-surface);
    --color-bg-muted: var(--bg-muted);
    --color-card: var(--card);
    --color-card-gray: var(--card-gray);
    --color-popover: var(--bg);
    --color-popover-gray: var(--card-gray);
    --color-overlay: var(--overlay);
    --color-overlay-gray: var(--overlay-gray);
    --color-progressbar: var(--progressbar);

    --color-border-strong: var(--border-strong);
    --color-border: var(--border);
    --color-border-sub: var(--border-sub);
    --color-border-card: var(--border-card);
    --color-border-input: var(--border-input);



    --color-primary-50: ...;
    /* ... */
    --color-primary-950: ..;

    --color-secondary-50: ....;
    /* ..... */
    --color-secondary-950: ....;


    /* override the default gray  */
    --color-gray-50:...;
    /* ... */
    --color-gray-950:...;
}