Foundation

Themes

Nerio separates brand theme, color mode, and density so one component API can work across many products without creating combined theme names.

Runtime axes

AxisAttributeValues
Themedata-themepurple, blue, green, orange, red, neutral, or custom
Modedata-modesystem, light, dark
Densitydata-densitycomfortable, compact

Preset themes

brand accents
ThemeAttribute valuePrimary accent token
Purpledata-theme="purple"--n-purple-600
Bluedata-theme="blue"--n-blue-600
Greendata-theme="green"--n-green-600
Orangedata-theme="orange"--n-orange-600
Reddata-theme="red"--n-red-600
Neutraldata-theme="neutral"--n-gray-950

Mode behavior

Light mode uses a white canvas, gray control surfaces, and white raised surfaces. Dark mode remaps the same roles to gray-950, gray-900, and gray-800. Purple and neutral also use lighter primary actions in dark and system-dark modes to preserve contrast.

The appearance control exposes System, Light, and Dark explicitly. System follows live OS preference changes, and theme, mode, and density selections are restored independently before hydration.

RoleToken
Canvas--n-color-surface-canvas
Control--n-color-surface-control
Raised surface--n-color-surface-raised
Primary action--n-color-action-primary
Action foreground--n-color-action-on-primary

Density

ValueUse
comfortableDefault spacing for mixed product and documentation surfaces.
compactRemaps semantic density aliases and component tokens for dense operational interfaces without changing primitive spacing values.

Custom themes

<html data-theme="purple" data-mode="system" data-density="comfortable">:root[data-theme="acme"] {  --n-color-surface-selected: var(--n-gray-a-8);  --n-color-border-focus: #0f766e;  --n-color-action-primary: #0f766e;  --n-color-action-primary-hover: #115e59;  --n-color-action-primary-active: #134e4a;  --n-color-action-on-primary: #ffffff;  --n-color-focus-ring: #0f766e;  --n-color-focus-ring-soft: rgb(15 118 110 / 0.24);  --n-chart-primary: #0f766e;}:root[data-theme="acme"][data-mode="dark"] {  --n-color-surface-selected: var(--n-white-a-10);  --n-color-border-focus: #5eead4;  --n-color-action-primary: #5eead4;  --n-color-action-primary-hover: #2dd4bf;  --n-color-action-primary-active: #14b8a6;  --n-color-action-on-primary: #042f2e;  --n-color-focus-ring: #5eead4;  --n-color-focus-ring-soft: rgb(94 234 212 / 0.3);  --n-chart-primary: #5eead4;}@media (prefers-color-scheme: dark) {  :root[data-theme="acme"][data-mode="system"] {    --n-color-surface-selected: var(--n-white-a-10);    --n-color-border-focus: #5eead4;    --n-color-action-primary: #5eead4;    --n-color-action-primary-hover: #2dd4bf;    --n-color-action-primary-active: #14b8a6;    --n-color-action-on-primary: #042f2e;    --n-color-focus-ring: #5eead4;    --n-color-focus-ring-soft: rgb(94 234 212 / 0.3);    --n-chart-primary: #5eead4;  }}
  • Do not create combined names such as purple-light or neutral-dark.
  • Do not use vertical-specific preset names such as fintech-blue.
  • Keep brand color as an accent for primary action, selection, focus, and charts.
  • Provide dark-mode accent overrides when the light accent loses contrast.

Do / do not

GuidanceRecommendation
DoUse generic brand theme names and let mode handle light or dark rendering.
Do notFork component source to hard-code a product color into a button or field.