NEURALNG
DESIGN SYSTEM

Theming

Start from stable visual defaults, customize a small semantic palette, or compile a complete product theme from one compact recipe.

CSS variablesLight and darkTailwind optional
The custom theming workflow is experimental.

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.

01

Primitives

Primary and surface scales

02

Semantics

Surface, text, border and focus

03

Components

Button, Input, Toast and every public token

04

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.

styles.css CSS
@import '@neural-ng/core/themes/neutral.css';
@import '@neural-ng/icons/icons.css';

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

blue

Surface

slate

Resolved preview

This picker uses the public NeuralAppearanceService. Register the provider once and inject the same Signal API in any application-owned settings panel.

app.config.ts TypeScript
import { provideNeuralAppearance } from '@neural-ng/core/appearance';

export const appConfig = {
  providers: [
    provideNeuralAppearance({
      primary: 'blue',
      surface: 'slate',
      mode: 'system',
      direction: 'auto',
    }),
  ],
};

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.

surface-0
surface-50
surface-100
surface-200
surface-300
surface-400
surface-500
surface-600
surface-700
surface-800
surface-900
surface-950
brand.css CSS
:root {
  --neural-color-primary-50: #eef2ff;
  --neural-color-primary-100: #e0e7ff;
  --neural-color-primary-200: #c7d2fe;
  --neural-color-primary-300: #a5b4fc;
  --neural-color-primary-400: #818cf8;
  --neural-color-primary-500: #6366f1;
  --neural-color-primary-600: #4f46e5;
  --neural-color-primary-700: #4338ca;
  --neural-color-primary-800: #3730a3;
  --neural-color-primary-900: #312e81;
  --neural-color-primary-950: #1e1b4b;
}

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-primary

Primary interactive emphasis

--neural-color-surface

Default elevated surface

--neural-color-text

Default foreground

--neural-color-text-muted

Secondary foreground

--neural-color-border

Default boundary

--neural-color-focus

Keyboard 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.

terminal Bash
npm install --save-dev @neural-ng/theme
npx neural-theme init
npx neural-theme validate
npx neural-theme build
neural.theme.json JSON
{
  "$schema": "./node_modules/@neural-ng/theme/schema.json",
  "schemaVersion": 1,
  "name": "agent-workspace",
  "extends": "neutral",
  "color": {
    "primary": "violet",
    "surface": "zinc",
    "success": "#16a34a",
    "warning": "#ca8a04",
    "error": "#dc2626"
  },
  "shape": { "radius": "medium", "border": "default" },
  "density": "comfortable",
  "elevation": "soft",
  "motion": "default",
  "modes": { "dark": "auto" }
}
styles.css CSS
@import 'tailwindcss';
@import '@neural-ng/icons/icons.css';
@import './styles/generated/agent-workspace.css';

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.

neural.theme.json JSON
{
  "components": {
    "button": {
      "radius": "1rem",
      "primaryBackground": "{color.primary}"
    },
    "toast": {
      "messageRadius": "1rem",
      "progressHeight": "0.25rem"
    }
  }
}
checkout.css CSS
.checkout-actions {
  --neural-button-radius: 999px;
  --neural-button-primary-background: var(--neural-color-primary-700);
}

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.

styles.css CSS
@import 'tailwindcss';
@import '@neural-ng/core/themes/neutral.css';
@import '@neural-ng/core/themes/tailwind.css';
@import '@neural-ng/icons/icons.css';

@custom-variant dark (
  &:where([data-neural-mode='dark'], [data-neural-mode='dark'] *)
);

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.

RECOMMENDED

Neutral

Use the maintained reference theme, then customize only stable primitive or documented component tokens when necessary.

FULL CONTROL

Unstyled

Remove NeuralNg visuals and build the complete design layer with Tailwind, application CSS or another styling system.

Experimental theme presets are intentionally not recommended here. Their names, values and availability may change or be removed before NeuralNg reaches a stable release.