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