Overview

Tokens capture raw design decisions like colors, spacing, and typography into named variables. They serve as the single source of truth for visual properties across all components and applications.

Consistency

Ensure visual consistency across all components and applications.

Maintainability

Update design decisions in one place and see changes everywhere.

Scalability

Build new features faster with a solid foundation of design decisions.

Token Categories

Our token system is organized into categories, each serving a specific purpose in the design language.

Usage

Tokens are distributed as CSS custom properties. Import them once in your application and use them throughout your styles.

Installation

npm install @enara-health/tokens

Import in CSS

@import '@enara-health/tokens/css';

Use in Styles

.button {
  background: var(--background-interactive-primary);
  color: var(--foreground-interactive-white);
  padding: var(--size-8) var(--size-16);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  transition: background var(--motion-duration-fast) var(--motion-easing-ease-out);
}

Architecture

Our token system follows a three-layer architecture for maximum flexibility and semantic meaning.

Foundation
Raw values like --color-moonstone-500, --size-16
Semantic
Contextual tokens like --foreground-base, --background-interactive-primary
Component
Components consume semantic tokens in their CSS modules

Best Practice: Always use semantic tokens in components. Foundation tokens should rarely be used directly in component styles.