@cookest/ui Components
Design Tokens Shared design tokens powering both React and Flutter components — colors, typography, spacing, and effects.
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 .
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
Token Value Usage primary.DEFAULT#7A9A65Primary brand sage green primary.light#B4CC9ELighter accent primary.dark#4E7A3ADarker accent, hover states
Token Light Dark Usage 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
Token Value Usage success#4CAF50Success states warning#FF9800Warning states error#F44336Error states, danger buttons info#2196F3Informational
Token Value Platform font.family.serifPlayfair Display Headings font.family.sansInter Body text font.family.monoJetBrains Mono Code
Token px Usage xs12 Badges, fine print sm14 Body small, buttons base16 Body default lg18 Large body xl20 Small headings 2xl24 Section headings 3xl30 Page titles 4xl36 Hero headings 5xl48 Display
Based on a 4px grid system :
Token px Semantic Alias 14 xs — tight elements28 sm — compact inputs312 md — default padding416 lg — spacious padding624 xl — card padding832 2xl — large sections1248 3xl — page spacing
Token px Usage sm4 Small elements md8 Inputs, badges lg12 Small buttons xl16 Buttons, cards, inputs 2xl24 Modals full9999 Circles, pills
# 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
.my-component {
color : var ( --ck-heading );
background : var ( --ck-surface );
border : 1 px solid var ( --ck-border );
}
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,
),
),
)