Theming
Start from stable visual defaults, customize a small semantic palette, or compile a complete product theme from one compact recipe.
For production applications, use the stable Neutral theme or enable unstyled and own the complete visual layer. Experimental presets and compiler contracts may change before the stable release.
ONE TOKEN PIPELINE
Theme layers
Components never hard-code a product palette. Primitive scales feed semantic colors; semantic colors feed component tokens; consumer classes and local custom properties remain the final override layer.
Primitives
Primary and surface scales
Semantics
Surface, text, border and focus
Components
Button, Input, Toast and every public token
Consumer
Scoped variables and typed class slots
For the stable reference theme, import Neutral once. It contains the full Core token graph and both color modes.
Live primary and surface palettes
Choose a palette to update the complete documentation shell. Primary owns emphasis and interaction; Surface owns canvas, elevation, text and borders. Light and dark modes consume the same immutable scales.
Primary
blueSurface
slateResolved preview
This picker uses the public NeuralAppearanceService. Register the provider once and inject the same Signal API in any application-owned settings panel.
Primitive scales stay stable
Primary exposes steps 50–950. Surface additionally exposes 0. The values do not reverse in dark mode; semantic aliases select suitable steps for the active mode.
Prefer semantic aliases in product CSS
Primitive steps are useful for deliberate palette work. General UI should consume semantic tokens so contrast decisions can change between light and dark without rewriting component CSS.
--neural-color-primaryPrimary interactive emphasis
--neural-color-surfaceDefault elevated surface
--neural-color-textDefault foreground
--neural-color-text-mutedSecondary foreground
--neural-color-borderDefault boundary
--neural-color-focusKeyboard focus indicator
Compile a product theme
EXPERIMENTAL@neural-ng/theme is a development dependency. A compact JSON recipe expands deterministically into complete Core and Editor CSS, token interchange JSON, diagnostics and generated theme-name types.
Generated CSS already contains the complete Core and Editor token graphs. Do not import Neutral beside the generated theme.
Keep overrides sparse and scoped
Use validated recipe properties for system-wide customization. Use a local CSS custom property when one product surface intentionally differs.
Unknown components, token names, malformed aliases, declaration injection and external CSS URLs fail theme validation.
Optional Tailwind CSS v4 bridge
The bridge maps NeuralNg primitives to Tailwind's color namespace. Utilities such as bg-primary-500, text-surface-950 and dark:bg-surface-900 then follow the active NeuralNg palette. NeuralNg has no Tailwind runtime dependency.
Production guidance
Until the theming API reaches a stable contract, choose one of the two supported production paths below. Do not build a long-lived product identity on experimental presets yet.
Neutral
Use the maintained reference theme, then customize only stable primitive or documented component tokens when necessary.
Unstyled
Remove NeuralNg visuals and build the complete design layer with Tailwind, application CSS or another styling system.