UI Components
Design Tokens Cookest design system tokens — colors, typography, spacing, radius, shadows, transitions, and z-index
Design tokens are the single source of truth for all visual decisions in CUCL. They are defined in src/tokens/ as TypeScript constants and exposed as CSS custom properties at runtime via @cookest/ui/styles.css.
import { colors, spacing, typography, effects } from "@cookest/ui/tokens" ;
Each token file also exports TypeScript types for full type safety:
import type { ColorToken, SpacingToken, FontFamilyToken } from "@cookest/ui/tokens" ;
Brand palette anchored on sage green (#7A9A65). All tokens have light and dark variants.
Token Light Dark Usage primary.DEFAULT#7A9A65#8AB575Buttons, active states, focus rings primary.light#B4CC9E#6B9A55Hover highlights primary.dark#4E7A3A#A8D490Pressed states
The full primary scale runs from primary.50 (#F0F5EC) to primary.950 (#1A2B14).
Token Light Dark CSS variable background#F5F5F0#0E1512--ck-bgcard#FAFAF6#172019--ck-bg-cardheading#1C3A2A#E0EDE4--ck-headingtext#3D5040#B0C8B5--ck-textmuted#7A8E74#6A8A70--ck-text-mutedborder#E4EBE0#253D2E--ck-bordersurface#FFFFFF#1A261E--ck-surface
Token Hex CSS variable Usage status.success#4CAF50--ck-successSuccess badges, alerts status.warning#FF9800--ck-warningWarning badges, alerts status.error#F44336--ck-errorError messages, danger buttons status.info#2196F3--ck-infoInformational badges, alerts
Components reference CSS custom properties — never hard-coded hex values. This means dark mode works automatically when the .dark class is applied to a parent:
// ✅ Correct — uses token
className = "text-[var(--ck-heading)]"
// ❌ Wrong — hard-coded colour
className = "text-[#1C3A2A]"
Two typefaces are used throughout the system:
Token Value Usage fontFamily.serif'Playfair Display', Georgia, …Headings, titles, display text fontFamily.sans'Inter', -apple-system, …Body text, labels, UI copy fontFamily.mono'JetBrains Mono', 'Fira Code', …Code blocks
Rule: Playfair Display is reserved for Modal titles and high-emphasis headings only. All UI elements use Inter.
Token Size Line height Usage fontSize.xs12px 16px Captions, helper text fontSize.sm14px 20px Labels, metadata fontSize.base16px 24px Body text fontSize.lg18px 28px Sub-headings fontSize.xl20px 28px Card titles fontSize.2xl24px 32px Section headings fontSize.3xl30px 36px Page headings fontSize.4xl36px 40px Hero text fontSize.5xl48px 1 Display text
Token Value fontWeight.light300 fontWeight.normal400 fontWeight.medium500 fontWeight.semibold600 fontWeight.bold700
Based on a 4px grid with semantic aliases for component padding and margins.
Token Value px equivalent spacing[1]0.25rem4px spacing[2]0.5rem8px spacing[3]0.75rem12px spacing[4]1rem16px spacing[5]1.25rem20px spacing[6]1.5rem24px spacing[8]2rem32px spacing[10]2.5rem40px spacing[12]3rem48px
Alias Value px Typical use componentSpacing.xs0.25rem4px Badge padding componentSpacing.sm0.5rem8px Compact inputs, small gaps componentSpacing.md0.75rem12px Default component padding componentSpacing.lg1rem16px Spacious padding componentSpacing.xl1.5rem24px Card padding, section gaps componentSpacing["2xl"]2rem32px Large section spacing componentSpacing["3xl"]3rem48px Page-level spacing
Token Value Usage radius.sm4px Small chips, tight elements radius.md8px Inputs, buttons radius.lg12px Modal footers, inner containers radius.xl16px Cards, modals radius["2xl"]24px Floating panels radius.full9999px Badges, avatars, pills
Token Value Usage shadow.sm0 1px 2px rgba(0,0,0,0.05)Subtle card lift shadow.md0 4px 6px -1px rgba(0,0,0,0.1)Dropdowns shadow.lg0 10px 15px -3px rgba(0,0,0,0.1)Modals shadow.primary0 4px 16px rgba(122,154,101,0.35)Primary buttons shadow.primaryHover0 8px 28px rgba(122,154,101,0.5)Primary button hover
Token Value Usage transition.fast150ms easeHover colour changes transition.normal250ms easeComponent show/hide transition.slow350ms easePage-level transitions transition.bounce500ms cubic-bezier(0.34, 1.56, 0.64, 1)Playful micro-interactions
Token Value Usage zIndex.dropdown10 Select dropdown panels zIndex.sticky20 Sticky headers zIndex.overlay30 Modal backdrops zIndex.modal40 Modal dialogs zIndex.popover50 Popovers zIndex.tooltip60 Tooltips
All semantic tokens map to CSS variables applied in :root (light) and .dark:
:root {
--ck-primary : #7a9a65 ;
--ck-primary-light : #b4cc9e ;
--ck-primary-dark : #4e7a3a ;
--ck-bg : #f5f5f0 ;
--ck-bg-card : #fafaf6 ;
--ck-heading : #1c3a2a ;
--ck-text : #3d5040 ;
--ck-text-muted : #7a8e74 ;
--ck-border : #e4ebe0 ;
--ck-surface : #ffffff ;
--ck-success : #4caf50 ;
--ck-warning : #ff9800 ;
--ck-error : #f44336 ;
--ck-info : #2196f3 ;
}
Always reference var(--ck-*) custom properties inside component class names rather than importing token constants. Token constants are for TypeScript logic; CSS variables are for styling.