generated:catalog.entry.themes.title
@xngui/theme@xngui/themegenerated:catalog.entry.themes.description
docs:themes.section.overview
docs:themes.heading.layers
docs:themes.caption.layers-lead
- docs:themes.layer.foundation
docs:themes.layer.foundation-detail
- docs:themes.layer.appearance
docs:themes.layer.appearance-detail
- docs:themes.layer.palette
docs:themes.layer.palette-detail
docs:themes.heading.choose-path
docs:themes.caption.choose-path-lead
docs:themes.path.css.title
docs:themes.path.css.tagline
docs:themes.path.css.when
- docs:themes.path.css.bullet-zero-js
- docs:themes.path.css.bullet-build
- docs:themes.path.css.bullet-framework
docs:themes.path.runtime.title
docs:themes.path.runtime.tagline
docs:themes.path.runtime.when
- docs:themes.path.runtime.bullet-picker
- docs:themes.path.runtime.bullet-switch
- docs:themes.path.runtime.bullet-persist
docs:themes.path.builder.title
docs:themes.path.builder.tagline
docs:themes.path.builder.when
- docs:themes.path.builder.bullet-prototype
- docs:themes.path.builder.bullet-export
- docs:themes.path.builder.bullet-anchors
styles.css@import '@xngui/styles';@import '@xngui/styles/themes/chromatic/blue';palette.tsimport { XPaletteService } from '@xngui/theme';inject(XPaletteService).setPalette('ocean');docs:themes.heading.related-docs
docs:styles.section.theme
docs:styles.heading.xngui-theme-services
docs:styles.caption.theme-services
XThemeServicedocs:styles.theme.tagline.xthemeservice
- docs:styles.theme.highlight.xthemeservice-mode
- docs:styles.theme.highlight.xthemeservice-dark-class
- docs:styles.theme.highlight.xthemeservice-persist
XThemeService.tsimport { XThemeService } from '@xngui/theme';const theme = inject(XThemeService);theme.mode(); // 'light' | 'dark' | 'system'theme.resolvedMode(); // 'light' | 'dark' after system resolvetheme.isDark(); // booleantheme.setMode('dark'); // persists to localStoragetheme.toggle(); // flips resolved light ↔ darktheme.cycle(); // light → dark → system → …XPaletteServicedocs:styles.theme.tagline.xpaletteservice
- docs:styles.theme.highlight.xpaletteservice-built-in
- docs:styles.theme.highlight.xpaletteservice-runtime
- docs:styles.theme.highlight.xpaletteservice-register
XPaletteService.tsimport { XPaletteService } from '@xngui/theme';const palettes = inject(XPaletteService);palettes.palette(); // active palette idpalettes.catalog(); // built-in + registered metapalettes.setPalette('blue'); // injects <style id="x-palette">palettes.registerPalette({ id: 'brand', label: 'Brand', description: 'Custom ramp.', icon: '🎨', tokens: { '--x-primary-500': 'oklch(0.55 0.14 250)' },});XTokenResolverdocs:styles.theme.tagline.xtokenresolver
- docs:styles.theme.highlight.xtokenresolver-resolve
- docs:styles.theme.highlight.xtokenresolver-invalidate
- docs:styles.theme.highlight.xtokenresolver-tools
XTokenResolver.tsimport { XTokenResolver } from '@xngui/theme';const tokens = inject(XTokenResolver);tokens.resolve('--x-primary'); // computedCSSValuetokens.invalidate(); // clear cache after theme/palette changedocs:styles.heading.appearance
docs:styles.caption.appearance
- docs:styles.data.preference
system- docs:styles.data.resolved
light- docs:styles.data.active-palette
default
theme.tsimport { XPaletteService, XThemeService } from '@xngui/theme';// Appearance — toggles .dark on <html>inject(XThemeService).setMode('dark');inject(XThemeService).toggle();// Primitive ramps — :root block in <style id="x-palette">inject(XPaletteService).setPalette('blue');docs:styles.section.predefined-themes
docs:styles.heading.curated-palettes
docs:styles.caption.curated-palettes
chrome:theme.category.chromatic-warm
Tailwind red → yellow chromatic ramps
- Red
- Orange
- Amber
- Yellow
chrome:theme.category.chromatic-fresh
Tailwind lime → teal chromatic ramps
- Lime
- Green
- Emerald
- Teal
chrome:theme.category.chromatic-cool
Tailwind cyan → indigo chromatic ramps
- Cyan
- Sky
- Blue
- Indigo
chrome:theme.category.chromatic-vivid
Tailwind violet → rose chromatic ramps
- Violet
- Purple
- Fuchsia
- Pink
- Rose
docs:styles.heading.nature-palettes
docs:styles.caption.nature-palettes
chrome:theme.category.nature-seasons
Spring, summer, autumn, and winter mood presets
- Spring
- Summer
- Autumn
- Winter
chrome:theme.category.nature-sky
Land, sea, and sky scene presets
- Sunset
- Ocean
- Forest
- Desert
- Aurora
- Starry night
- Mountain
- Rain
docs:styles.heading.branding-palettes
docs:styles.caption.branding-palettes
chrome:theme.category.branding
Palettes inspired by published design systems — not official products
- GitHub
- Dracula
- Material
- Nord
- Catppuccin
- Tokyo Night
- Gruvbox
docs:styles.heading.utility-palettes
docs:styles.caption.utility-palettes
chrome:theme.category.utility
Minimal and accessibility-focused presets
- Monochrome
- High contrast
docs:styles.heading.brand-spectrum
docs:styles.caption.brand-spectrum
primarysecondaryaccentneutralsuccesswarningdangerinfoprimarysecondaryaccentneutralsuccesswarningdangerinfoprimarysecondaryaccentneutralsuccesswarningdangerinfoprimarysecondaryaccentneutralsuccesswarningdangerinfodocs:styles.heading.custom-palettes
docs:styles.caption.custom-palettes docs:styles.link.theme-builderdocs:styles.caption.custom-palettes-suffix
palettes.tsimport { provideXPalettes } from '@xngui/theme';export const appConfig = { providers: [ provideXPalettes([ { id: 'brand', label: 'Brand', description: 'Company primary ramp.', icon: '🎨', tokens: { 'x-primary-500': 'oklch(0.55 0.14 250)', 'x-primary-600': 'oklch(0.48 0.16 250)', }, }, ]), ],};register.tsimport { XPaletteService } from '@xngui/theme';const palettes = inject(XPaletteService);palettes.registerPalette({ id: 'brand', label: 'Brand', description: 'Runtime palette.', icon: '🎨', tokens: { '--x-primary-500': 'oklch(0.55 0.14 250)' },});palettes.setPalette('brand');