Skip to content

@web-engine-dev/design-tokens

Visual design language for the editor UI. Defines colors, typography, spacing, shadows, border radii, and animation curves as CSS custom properties and TypeScript constants for consistent editor theming.

Layer 8 · Content

Features

  • Color Palette: Semantic color tokens (surface, text, accent, error, warning, success)
  • Dark & Light Themes: Complete token sets for both themes with smooth transitions
  • Typography Scale: Font families, sizes, weights, and line heights
  • Spacing Scale: Consistent spacing values (4px base unit)
  • Elevation System: Shadow tokens for layered depth (panels, dropdowns, modals)
  • Border Radii: Consistent corner rounding tokens
  • Animation Curves: Timing functions and durations for UI transitions
  • Icon Set: Monochrome icon tokens with size variants
  • CSS Custom Properties: Runtime theme switching via property overrides
  • TypeScript Constants: Type-safe access to all tokens in code

Installation

bash
npm install @web-engine-dev/design-tokens
# or
pnpm add @web-engine-dev/design-tokens

Quick Start

typescript
import { tokens, applyTheme } from '@web-engine-dev/design-tokens';

// Apply dark theme
applyTheme('dark');

// Access tokens in TypeScript
const panelBg = tokens.color.surface.primary; // '#1e1e1e'
const textColor = tokens.color.text.primary; // '#cccccc'
const spacing = tokens.spacing.md; // '12px'
const radius = tokens.radius.md; // '6px'
css
/* Use tokens in CSS */
.panel {
  background: var(--surface-primary);
  color: var(--text-primary);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  box-shadow: var(--elevation-2);
}

Token Categories

CategoryExamplesFormat
Colorsurface.primary, text.secondary, accent.blueHex, HSL
Typographyfont.mono, size.sm, weight.boldpx, rem
Spacingspacing.xs (4px) through spacing.xxl (48px)px
Elevationelevation.1 through elevation.5CSS shadow
Radiusradius.sm (2px) through radius.full (9999px)px
Animationduration.fast (100ms), easing.standardms, cubic-bezier

Dependencies

None — design tokens are a standalone package with zero runtime dependencies.

Proprietary software. All rights reserved.