Skip to Content
Neshel-UI
Configuration

Tokens and defaults

The colour roles, contrast pairs and default values exported as frozen data.

The JavaScript entry exports the token contract as frozen data, useful for tooling, documentation and tests. It is side-effect free and browser-safe.

list-roles.ts
import { colorRoles, contrastPairs, defaults } from "@neshel-ui/config";

console.log(colorRoles.length); // 25
for (const pair of contrastPairs) {
  console.log(`${pair.foreground} on ${pair.background}: ≥ ${pair.minimum}:1`);
}
console.log(defaults.themes.light.primary); // "#193767"

ColorRole

One of the 25 semantic colour roles, in canonical order (see colorRoles).

type ColorRole = (typeof colorRoles)[number]

ContrastPair

A foreground/background pair whose contrast is checked.

ContrastPair
PropTypeDefaultDescription
background(required)ColorRole——
criterion(required)"1.4.3" | "1.4.11" | "exempt"——
foreground(required)ColorRole——
minimum(required)4.5 | 3 | null—Minimum WCAG 2.1 ratio, or null for a documented exemption.

Defaults

Built-in default values of the token contract.

Defaults
PropTypeDefaultDescription
breakpoints(required){ readonly [B in DefaultBreakpointName]: BreakpointWidth; }—Default breakpoints (Tailwind CSS v4 defaults).
focus(required){ readonly width: LengthValue; readonly offset: LengthValue; }——
radius(required){ readonly base: LengthValue; }——
spacing(required){ readonly unit: LengthValue; }——
themes(required){ readonly light: ThemeColors; readonly dark: ThemeColors; }——
typography(required){ readonly families: { readonly [F in FontRole]: readonly string[]; }; /** Default metrics (Inter for body and display; none for mono). */ readonly metrics: Partial<Record<FontRole, FontMetrics>>; }——

CSS custom properties

TokenExample (light default)
--neshel-<role>--neshel-primary: #193767
--neshel-radius-base (-sm … -xl, -full)0.75rem
--neshel-spacing0.25rem (layout spacing unit)
--neshel-font-body / -display / -monofont stacks
--neshel-font-<role>-scale, -cap-trim, -baseline-trim, -trimCapsize constants
--neshel-focus-width, --neshel-focus-offset2px, 2px

Tailwind consumers (tailwind.css) also get utilities such as bg-neshel-primary, text-neshel-muted-foreground, border-neshel-border and rounded-neshel-md.

Edit on GitHub

On this page