Cookest
@cookest/ui Components

Design Tokens

Shared design tokens powering both React and Flutter components — colors, typography, spacing, and effects.

Design Tokens

Design tokens are the single source of truth for the Cookest design system. They are defined as platform-agnostic JSON and built into CSS custom properties (React) and Dart constants (Flutter) via Style Dictionary.

Token Files

ui-components/tokens/
├── colors.json       # Full color palette with light/dark modes
├── spacing.json      # 4px grid + semantic aliases
├── typography.json   # Font families, sizes, weights, line heights
└── effects.json      # Border radius, shadows, transitions, z-index

Colors

Brand Palette

TokenValueUsage
primary.DEFAULT#7A9A65Primary brand sage green
primary.light#B4CC9ELighter accent
primary.dark#4E7A3ADarker accent, hover states

Semantic Colors (Light / Dark)

TokenLightDarkUsage
background#F5F5F0#0E1512Page background
card#FAFAF6#172019Card surfaces
heading#1C3A2A#E0EDE4Heading text
text#3D5040#B0C8B5Body text
muted#7A8E74#6A8A70Placeholder/helper text
border#E4EBE0#253D2EBorders and dividers
surface#FFFFFF#1A261EComponent surfaces

Status Colors

TokenValueUsage
success#4CAF50Success states
warning#FF9800Warning states
error#F44336Error states, danger buttons
info#2196F3Informational

Typography

TokenValuePlatform
font.family.serifPlayfair DisplayHeadings
font.family.sansInterBody text
font.family.monoJetBrains MonoCode

Font Sizes

TokenpxUsage
xs12Badges, fine print
sm14Body small, buttons
base16Body default
lg18Large body
xl20Small headings
2xl24Section headings
3xl30Page titles
4xl36Hero headings
5xl48Display

Spacing

Based on a 4px grid system:

TokenpxSemantic Alias
14xs — tight elements
28sm — compact inputs
312md — default padding
416lg — spacious padding
624xl — card padding
8322xl — large sections
12483xl — page spacing

Border Radius

TokenpxUsage
sm4Small elements
md8Inputs, badges
lg12Small buttons
xl16Buttons, cards, inputs
2xl24Modals
full9999Circles, pills

Building Tokens

# From ui-components/
bun run tokens:build

This generates:

  • tokens/build/styles.generated.css — CSS custom properties for React
  • tokens/build/cookest_tokens.dart — Dart constants for Flutter

Using Tokens

React (CSS Custom Properties)

.my-component {
  color: var(--ck-heading);
  background: var(--ck-surface);
  border: 1px solid var(--ck-border);
}

Flutter (Dart Constants)

import 'package:cookest_ui/cookest_ui.dart';

Container(
  color: CookestTokens.colorSurfaceLight,
  padding: EdgeInsets.all(CookestTokens.spacingN4),
  child: Text(
    'Hello',
    style: TextStyle(
      color: CookestTokens.colorHeadingLight,
      fontSize: CookestTokens.fontSizeBase,
    ),
  ),
)

On this page