chrome:shell.skip

generated:catalog.entry.themes.title

@xngui/theme
@xngui/theme

generated:catalog.entry.themes.description

docs:themes.section.overview

docs:themes.heading.layers

docs:themes.caption.layers-lead

  1. docs:themes.layer.foundation

    docs:themes.layer.foundation-detail

  2. docs:themes.layer.appearance

    docs:themes.layer.appearance-detail

  3. 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.link.styles-docs

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
docs:themes.link.builder-docs
styles.css
@import '@xngui/styles';@import '@xngui/styles/themes/chromatic/blue';
palette.ts
import { XPaletteService } from '@xngui/theme';inject(XPaletteService).setPalette('ocean');

docs:styles.section.theme

docs:styles.heading.xngui-theme-services

docs:styles.caption.theme-services

XThemeService

docs:styles.theme.tagline.xthemeservice

  • docs:styles.theme.highlight.xthemeservice-mode
  • docs:styles.theme.highlight.xthemeservice-dark-class
  • docs:styles.theme.highlight.xthemeservice-persist
XThemeService.ts
import { 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 → …
XPaletteService

docs:styles.theme.tagline.xpaletteservice

  • docs:styles.theme.highlight.xpaletteservice-built-in
  • docs:styles.theme.highlight.xpaletteservice-runtime
  • docs:styles.theme.highlight.xpaletteservice-register
XPaletteService.ts
import { 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)' },});
XTokenResolver

docs:styles.theme.tagline.xtokenresolver

  • docs:styles.theme.highlight.xtokenresolver-resolve
  • docs:styles.theme.highlight.xtokenresolver-invalidate
  • docs:styles.theme.highlight.xtokenresolver-tools
XTokenResolver.ts
import { XTokenResolver } from '@xngui/theme';const tokens = inject(XTokenResolver);tokens.resolve('--x-primary'); // computedCSSValuetokens.invalidate(); // clear cache after theme/palette change

docs:styles.heading.appearance

docs:styles.caption.appearance

docs:styles.data.preference
system
docs:styles.data.resolved
light
docs:styles.data.active-palette
default
theme.ts
import { 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

  • RedTailwind Red brand spectrum — full 50–950 ramps with wheel-neighbor accent and tinted semantics; page chrome stays on default achromatic neutrals.@import '@xngui/styles/themes/chromatic/red';
  • OrangeTailwind Orange brand spectrum — full 50–950 ramps with wheel-neighbor accent and tinted semantics; page chrome stays on default achromatic neutrals.@import '@xngui/styles/themes/chromatic/orange';
  • AmberTailwind Amber brand spectrum — full 50–950 ramps with wheel-neighbor accent and tinted semantics; page chrome stays on default achromatic neutrals.@import '@xngui/styles/themes/chromatic/amber';
  • YellowTailwind Yellow brand spectrum — full 50–950 ramps with wheel-neighbor accent and tinted semantics; page chrome stays on default achromatic neutrals.@import '@xngui/styles/themes/chromatic/yellow';

chrome:theme.category.chromatic-fresh

Tailwind lime → teal chromatic ramps

  • LimeTailwind Lime brand spectrum — full 50–950 ramps with wheel-neighbor accent and tinted semantics; page chrome stays on default achromatic neutrals.@import '@xngui/styles/themes/chromatic/lime';
  • GreenTailwind Green brand spectrum — full 50–950 ramps with wheel-neighbor accent and tinted semantics; page chrome stays on default achromatic neutrals.@import '@xngui/styles/themes/chromatic/green';
  • EmeraldTailwind Emerald brand spectrum — full 50–950 ramps with wheel-neighbor accent and tinted semantics; page chrome stays on default achromatic neutrals.@import '@xngui/styles/themes/chromatic/emerald';
  • TealTailwind Teal brand spectrum — full 50–950 ramps with wheel-neighbor accent and tinted semantics; page chrome stays on default achromatic neutrals.@import '@xngui/styles/themes/chromatic/teal';

chrome:theme.category.chromatic-cool

Tailwind cyan → indigo chromatic ramps

  • CyanTailwind Cyan brand spectrum — full 50–950 ramps with wheel-neighbor accent and tinted semantics; page chrome stays on default achromatic neutrals.@import '@xngui/styles/themes/chromatic/cyan';
  • SkyTailwind Sky brand spectrum — full 50–950 ramps with wheel-neighbor accent and tinted semantics; page chrome stays on default achromatic neutrals.@import '@xngui/styles/themes/chromatic/sky';
  • BlueTailwind Blue brand spectrum — full 50–950 ramps with wheel-neighbor accent and tinted semantics; page chrome stays on default achromatic neutrals.@import '@xngui/styles/themes/chromatic/blue';
  • IndigoTailwind Indigo brand spectrum — full 50–950 ramps with wheel-neighbor accent and tinted semantics; page chrome stays on default achromatic neutrals.@import '@xngui/styles/themes/chromatic/indigo';

chrome:theme.category.chromatic-vivid

Tailwind violet → rose chromatic ramps

  • VioletTailwind Violet brand spectrum — full 50–950 ramps with wheel-neighbor accent and tinted semantics; page chrome stays on default achromatic neutrals.@import '@xngui/styles/themes/chromatic/violet';
  • PurpleTailwind Purple brand spectrum — full 50–950 ramps with wheel-neighbor accent and tinted semantics; page chrome stays on default achromatic neutrals.@import '@xngui/styles/themes/chromatic/purple';
  • FuchsiaTailwind Fuchsia brand spectrum — full 50–950 ramps with wheel-neighbor accent and tinted semantics; page chrome stays on default achromatic neutrals.@import '@xngui/styles/themes/chromatic/fuchsia';
  • PinkTailwind Pink brand spectrum — full 50–950 ramps with wheel-neighbor accent and tinted semantics; page chrome stays on default achromatic neutrals.@import '@xngui/styles/themes/chromatic/pink';
  • RoseTailwind Rose brand spectrum — full 50–950 ramps with wheel-neighbor accent and tinted semantics; page chrome stays on default achromatic neutrals.@import '@xngui/styles/themes/chromatic/rose';

docs:styles.heading.nature-palettes

docs:styles.caption.nature-palettes

chrome:theme.category.nature-seasons

Spring, summer, autumn, and winter mood presets

  • SpringCherry blossom pink with fresh bud green — renewal and soft rain.@import '@xngui/styles/themes/nature/spring';
  • SummerOpen sky blue with sun gold accents — high sun and beach heat.@import '@xngui/styles/themes/nature/summer';
  • AutumnHarvest amber and rust with burgundy shadows — dry leaves and dusk.@import '@xngui/styles/themes/nature/autumn';
  • WinterSnow white chrome with frost blue — ice, crisp air, short days.@import '@xngui/styles/themes/nature/winter';

chrome:theme.category.nature-sky

Land, sea, and sky scene presets

  • SunsetWarm coral and amber glow with rose accents — inviting golden hour.@import '@xngui/styles/themes/nature/sunset';
  • OceanDeep sea blue primary with teal foam accents — calm and professional.@import '@xngui/styles/themes/nature/ocean';
  • ForestMossy greens and bark browns — organic, grounded, easy on the eyes.@import '@xngui/styles/themes/nature/forest';
  • DesertSaharan sand and terracotta with cool dusk teal shadows.@import '@xngui/styles/themes/nature/desert';
  • AuroraNorthern lights — mint and violet on a polar night sky.@import '@xngui/styles/themes/nature/aurora';
  • Starry nightMoonlit teal on midnight void — clear cold sky.@import '@xngui/styles/themes/nature/starry-night';
  • MountainAlpine slate and mist gray with pine green accents.@import '@xngui/styles/themes/nature/mountain';
  • RainStorm sky blue with wet green — lush air after rainfall.@import '@xngui/styles/themes/nature/rain';

docs:styles.heading.branding-palettes

docs:styles.caption.branding-palettes

chrome:theme.category.branding

Palettes inspired by published design systems — not official products

  • GitHubInspired by GitHub Primer — success green primary with Primer blue accent.@import '@xngui/styles/themes/branding/github';
  • DraculaInspired by Dracula — purple primary with cyan accent and vivid semantics.@import '@xngui/styles/themes/branding/dracula';
  • MaterialInspired by Material 3 baseline — purple primary with balanced secondary containers.@import '@xngui/styles/themes/branding/material';
  • NordInspired by Nord — arctic frost blue primary on polar night neutrals.@import '@xngui/styles/themes/branding/nord';
  • CatppuccinInspired by Catppuccin Mocha — mauve primary with pastel blue accent.@import '@xngui/styles/themes/branding/catppuccin';
  • Tokyo NightInspired by Tokyo Night — electric blue primary with violet accent.@import '@xngui/styles/themes/branding/tokyo-night';
  • GruvboxInspired by Gruvbox — warm orange primary with retro earth-tone semantics.@import '@xngui/styles/themes/branding/gruvbox';

docs:styles.heading.utility-palettes

docs:styles.caption.utility-palettes

chrome:theme.category.utility

Minimal and accessibility-focused presets

  • MonochromeAchromatic ramps across all roles — minimal, timeless, print-like.@import '@xngui/styles/themes/utility/monochrome';
  • High contrastStrong foreground separation and saturated role fills for accessibility.@import '@xngui/styles/themes/utility/high-contrast';

docs:styles.heading.brand-spectrum

docs:styles.caption.brand-spectrum

Red
primary
secondary
accent
neutral
success
warning
danger
info
Green
primary
secondary
accent
neutral
success
warning
danger
info
Blue
primary
secondary
accent
neutral
success
warning
danger
info
Violet
primary
secondary
accent
neutral
success
warning
danger
info

docs:styles.heading.custom-palettes

docs:styles.caption.custom-palettes docs:styles.link.theme-builderdocs:styles.caption.custom-palettes-suffix

palettes.ts
import { 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.ts
import { 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');