Foundation

Tokens

Nerio uses primitive, semantic, and component tokens plus composable runtime sets so visual decisions remain portable across themes, products, and source-installed components.

Token architecture

CSS variables
LayerPurposeExamples
PrimitiveRaw values without product meaning. Use them to build semantic tokens, not product UI directly.
--n-purple-600--n-gray-a-8--n-space-4--n-radius-md
SemanticIntent-based values remapped by theme, mode, density, and product overrides.
--n-color-surface-control--n-color-text-primary--n-color-action-primary--n-radius-container
ComponentScoped contracts for component customization without editing component source.
--n-button-height-md--n-input-height-md--n-form-group-gap--n-dialog-width-md--n-overlay-z-index
Runtime setsComposable selectors that remap semantic and component tokens without rebuilding source.
data-themedata-modedata-density

Primitive tokens

Primitive tokens are immutable raw values. Theme, mode, and density selectors never redefine them; runtime changes remap semantic and component aliases instead.

Nerio uses a hybrid neutral foundation. Opaque grays anchor canvas, primary surfaces, text, actions, and contrast-critical roles. Cool dark alpha neutrals in light mode and white alpha neutrals in dark mode drive adaptive controls, hover and pressed states, selected surfaces, subdued borders, and grid lines. Their compositing is intentional: the same semantic layer remains legible when it is placed on white or on a muted group surface.

ColorToken
gray-0--n-gray-0
gray-100--n-gray-100
gray-500--n-gray-500
gray-950--n-gray-950
cool gray alpha 8%--n-gray-a-8
white alpha 10%--n-white-a-10
purple-600--n-purple-600
blue-600--n-blue-600
green-600--n-green-600
orange-600--n-orange-600
red-600--n-red-600
ScaleTokenDefault
Spacing--n-space-416px on the comfortable scale
Control size--n-size-control-md32px default control height
Radius--n-radius-md16px primitive corner
Icon size--n-icon-size-md16px default icon size
Border width--n-border-width-default1px default border
Elevation--n-shadow-smRestrained raised-surface shadow

Semantic tokens

Components consume semantic roles, never alpha primitives directly. Mode selectors map adaptive roles to --n-gray-a-* or --n-white-a-*, while opaque canvas, foreground, primary action, status, and chart-series roles retain predictable contrast.

RoleToken
Canvas--n-color-surface-canvas
Default surface--n-color-surface-default
Control--n-color-surface-control
Control hover--n-color-surface-control-hover
Subtle--n-color-surface-subtle
Sunken--n-color-surface-sunken
Raised--n-color-surface-raised
Overlay--n-color-surface-overlay
Primary text--n-color-text-primary
Secondary text--n-color-text-secondary
Subtle border--n-color-border-subtle
Primary action--n-color-action-primary
RoleAliasDefault
Adaptive control--n-color-surface-control--n-gray-a-6 / --n-white-a-8
Adaptive border--n-color-border-default--n-gray-a-10 / --n-white-a-10
Density spacing--n-density-space-md--n-space-3
Density spacing--n-density-space-lg--n-space-4
Density spacing--n-density-space-xl--n-space-5
Control radius--n-radius-control--n-radius-lg
Container radius--n-radius-container--n-radius-xl
Overlay radius--n-radius-overlay--n-radius-2xl
Raised elevation--n-shadow-surface-raised--n-shadow-sm
Floating elevation--n-shadow-surface-floating--n-shadow-md
Body type--n-body-font-size--n-font-size-md

Contrast contract

Contrast targets document the minimum intended ratio for Core roles. Customize contrast by overriding semantic color variables such as --n-color-text-primary and --n-color-action-primary; contrast targets are documentation tokens, not a runtime axis.

RoleTargetMinimum
Primary and secondary text--n-contrast-text-primary / --n-contrast-text-secondary4.5:1
Tertiary and status text--n-contrast-text-tertiary / --n-contrast-status3:1
Action and inverse text--n-contrast-action / --n-contrast-text-inverse4.5:1
Focus indication--n-contrast-focus-ring3:1

Tailwind bridge

Tailwind CSS v4 is the Core component authoring engine. The bridge exposes stable Nerio foundation and semantic variables as utilities without copying their values into Tailwind. Component recipes may reference narrower component variables directly with static arbitrary utilities.

UtilityValue sourceUse
bg-n-surface--n-color-surfaceDefault product and component surface.
text-n-text--n-color-text-primaryPrimary foreground.
border-n-border--n-color-border-defaultDefault border color.
rounded-n-control--n-radius-controlControl shape role.
p-n-4--n-space-4Token-backed spacing.

Component tokens

TokenUse
Button height--n-button-height-md
Button radius--n-button-radius
Button padding--n-button-padding-inline-md
Icon button glyph--n-icon-button-icon-size-md
Input height--n-input-height-md
Input background--n-input-background
Badge height--n-badge-height
Card radius--n-card-radius
Card elevation--n-card-shadow
Dialog width--n-dialog-width-md
Overlay layer--n-overlay-z-index

Usage

/* Product CSS: add a theme without changing component source. */: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;}.project-search {  min-block-size: var(--n-input-height-md);  border-radius: var(--n-input-radius);  background: var(--n-input-background);}
  • Use primitive tokens only when defining semantic or component tokens.
  • Keep primitive values unchanged across theme, mode, and density selectors.
  • Use semantic tokens for product layout, copy, borders, actions, and status.
  • Use component tokens to adjust a component contract without forking source.
  • Keep Tailwind recipes static and use the Nerio bridge instead of raw palette utilities.
  • Use runtime sets to remap tokens; do not encode mode or density into theme names.