API Reference

Complete reference for Turbo Themes tokens, CSS variables, and JavaScript API.

API Reference

Complete reference documentation for Turbo Themes.

ReferenceDescription
CSS VariablesAll --turbo-* custom properties
Design TokensToken structure and organization
Theme DefinitionsAll 9 themes with their values
JavaScript APITheme switching functions

Token Overview

Turbo Themes provides semantic design tokens organized into categories:

Background Tokens

TokenCSS VariablePurpose
Base--turbo-bg-baseMain page background
Surface--turbo-bg-surfaceCards, elevated surfaces
Overlay--turbo-bg-overlayModals, dropdowns

Text Tokens

TokenCSS VariablePurpose
Primary--turbo-text-primaryMain body text
Secondary--turbo-text-secondaryMuted text
Inverse--turbo-text-inverseText on colored backgrounds

Brand Tokens

TokenCSS VariablePurpose
Primary--turbo-brand-primaryPrimary accent, CTAs

State Tokens

TokenCSS VariablePurpose
Success--turbo-state-successSuccess messages
Warning--turbo-state-warningWarning messages
Danger--turbo-state-dangerError messages
Info--turbo-state-infoInfo messages

Border Tokens

TokenCSS VariablePurpose
Default--turbo-border-defaultStandard borders

Syntax Tokens

For code syntax highlighting:

TokenCSS VariablePurpose
Comment--turbo-syntax-commentCode comments
Keyword--turbo-syntax-keywordLanguage keywords
String--turbo-syntax-stringString literals
Number--turbo-syntax-numberNumeric values
Function--turbo-syntax-functionFunction names
Type--turbo-syntax-typeType annotations

Package Exports

CSS Files

turbo-themes/
β”œβ”€β”€ css/
β”‚   β”œβ”€β”€ turbo-core.css        # Token definitions
β”‚   β”œβ”€β”€ turbo-base.css        # Base styles
β”‚   β”œβ”€β”€ turbo-syntax.css      # Syntax highlighting
β”‚   β”œβ”€β”€ themes/turbo/         # Theme files
β”‚   β”‚   β”œβ”€β”€ catppuccin-mocha.css
β”‚   β”‚   β”œβ”€β”€ catppuccin-latte.css
β”‚   β”‚   └── ...
β”‚   └── adapters/
β”‚       └── bulma.css         # Bulma adapter

JavaScript/TypeScript

import { themeIds, type ThemeId } from 'turbo-themes';

// Array of all theme IDs
themeIds: string[]

// Theme ID type
type ThemeId = 'catppuccin-mocha' | 'catppuccin-latte' | ...

Next Steps