@stellaria/nebula-themes
v1.1.4
Published
Temas oficiales, Zod schema del theme y presets del design system Nebula
Downloads
823
Readme
@stellaria/nebula-themes
The official themes and the runtime validator. light and dark, built on the indigo→violet axis,
plus the Zod schema that checks any theme you load at runtime.
Install
pnpm add @stellaria/nebula-themes @stellaria/nebula-tokensWhat you get
import { Themes, LoadTheme } from "@stellaria/nebula-themes";
// Ship one of the two…
const dark = Themes.nebula.dark;
// …or validate your own before handing it to the provider.
const mine = LoadTheme(await (await fetch("/tenant-theme.json")).json());Themeskeyed by identity, each with itsdarkandlight(ADR-166), plusTHEME_NAMESto iterate them andDark/Lightfor the default pair.LoadTheme— parses and validates againstthemeSchema, and throws aThemeValidationErrorthat names the offending path. Use it on anything that did not come from your own build.themeSchemaif you want to validate without loading.FlipScalefor building a dark scale from a light one.
A theme is plain JSON that satisfies NebulaTheme, so the same file feeds web and native. Every
official theme passes WCAG 2.2 AA on every text/surface pair in CI — 158 pairs each.
Compatibility
ESM only. Node 20+ to build. Depends on zod for the runtime schema; the type contract itself lives
in @stellaria/nebula-tokens and carries no dependencies.
Documentation
Licence
MIT.
