Skip to content

Theming

thundrex ships with three built-in themes and full support for custom themes.

Built-in Themes

ThemeDescription
lightDefault — soft gray bg
darkTrue black surface
oceanCool blue tones

Switching Themes

ts
import { setTheme, resetTheme } from '@thundrex/web-components';

setTheme('dark');
setTheme('ocean');
resetTheme(); // back to light

Custom Themes

Pass a partial theme object to override specific tokens:

ts
setTheme({
  accent: '#E040FB',
  primary: '#00BCD4',
  bg: '#FAFAFA',
});

CSS Custom Properties

You can also override tokens directly in CSS:

css
:root {
  --tx-primary: #e040fb;
  --tx-accent: #00bcd4;
  --tx-bg: #fafafa;
}

Available Tokens

TokenDescription
--tx-bgPage background
--tx-surfaceCard/component surface
--tx-surface-altAlternate surface
--tx-accentAccent color
--tx-primaryPrimary color
--tx-successSuccess color
--tx-dangerDanger color
--tx-textPrimary text
--tx-text-secondarySecondary text
--tx-text-mutedMuted text
--tx-borderBorder color