feat: add design tokens as CSS custom properties
Create src/styles/tokens.css with complete design token system including: - Surface, text, accent, code, border, focus colors - State colors (success, warning, error, info) - Shadow definitions - Typography families with full fallback stacks - Typography scale (xs through 3xl) and line heights - Spacing scale (0 through 12) - Border radius tokens - Layout constraints (prose, code, container widths) - Motion tokens with reduced-motion media query All values sourced from .design/specs/design-tokens-2026-05-26.md. Includes verification test with 56 assertions across all categories.
This commit is contained in:
@@ -0,0 +1,120 @@
|
||||
:root {
|
||||
/* Surfaces */
|
||||
--surface-base: #F5F0E8;
|
||||
--surface-card: #FEFCF7;
|
||||
--surface-code: #EEEAE2;
|
||||
--surface-inset: #E8E3DA;
|
||||
|
||||
/* Text */
|
||||
--text-primary: #2B2421;
|
||||
--text-secondary: #6B5F55;
|
||||
--text-tertiary: #948880;
|
||||
|
||||
/* Accents */
|
||||
--accent-primary: #A0522D;
|
||||
--accent-primary-hover: #8B4726;
|
||||
--accent-secondary: #7D6C2F;
|
||||
--accent-secondary-hover: #6B5C28;
|
||||
|
||||
/* Code */
|
||||
--code-text: #3D342E;
|
||||
|
||||
/* Borders */
|
||||
--border-subtle: #DDD7CD;
|
||||
--border-default: #C2BAA9;
|
||||
--border-strong: #8E857A;
|
||||
|
||||
/* Focus */
|
||||
--focus-ring: #A0522D;
|
||||
|
||||
/* State: Success */
|
||||
--success-bg: #E8EDDF;
|
||||
--success-text: #4A5E3A;
|
||||
--success-border: #B5C4A0;
|
||||
|
||||
/* State: Warning */
|
||||
--warning-bg: #F2E8D0;
|
||||
--warning-text: #7A5C1F;
|
||||
--warning-border: #D4BC7C;
|
||||
|
||||
/* State: Error */
|
||||
--error-bg: #F2DED6;
|
||||
--error-text: #8B3A2A;
|
||||
--error-border: #CFA090;
|
||||
|
||||
/* State: Info */
|
||||
--info-bg: #E5E2DA;
|
||||
--info-text: #4A4540;
|
||||
--info-border: #B8B2A8;
|
||||
|
||||
/* Shadows */
|
||||
--shadow-sm: 0 1px 3px rgba(43, 36, 33, 0.04);
|
||||
--shadow-md: 0 2px 8px rgba(43, 36, 33, 0.06);
|
||||
|
||||
/* Typography families */
|
||||
--font-prose: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
|
||||
--font-structure: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
||||
--font-evidence: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
|
||||
|
||||
/* Typography scale */
|
||||
--type-xs: 0.75rem;
|
||||
--type-sm: 0.875rem;
|
||||
--type-base: 1.125rem;
|
||||
--type-lg: 1.375rem;
|
||||
--type-xl: 1.75rem;
|
||||
--type-2xl: 2.25rem;
|
||||
--type-3xl: 2.75rem;
|
||||
|
||||
/* Line heights */
|
||||
--leading-tight: 1.15;
|
||||
--leading-snug: 1.25;
|
||||
--leading-heading: 1.35;
|
||||
--leading-normal: 1.5;
|
||||
--leading-relaxed: 1.6;
|
||||
--leading-prose: 1.7;
|
||||
|
||||
/* Spacing */
|
||||
--space-0: 0;
|
||||
--space-px: 1px;
|
||||
--space-0-5: 0.25rem;
|
||||
--space-1: 0.5rem;
|
||||
--space-1-5: 0.75rem;
|
||||
--space-2: 1rem;
|
||||
--space-2-5: 1.25rem;
|
||||
--space-3: 1.5rem;
|
||||
--space-4: 2rem;
|
||||
--space-5: 2.5rem;
|
||||
--space-6: 3rem;
|
||||
--space-8: 4rem;
|
||||
--space-10: 5rem;
|
||||
--space-12: 6rem;
|
||||
|
||||
/* Border radius */
|
||||
--rounded-none: 0;
|
||||
--rounded-sm: 2px;
|
||||
--rounded-md: 4px;
|
||||
--rounded-lg: 6px;
|
||||
--rounded-xl: 8px;
|
||||
--rounded-full: 9999px;
|
||||
|
||||
/* Layout */
|
||||
--width-prose: 45rem;
|
||||
--width-code: 52.5rem;
|
||||
--width-container: 68.75rem;
|
||||
--gutter: 1.5rem;
|
||||
|
||||
/* Motion */
|
||||
--duration-fast: 100ms;
|
||||
--duration-normal: 150ms;
|
||||
--duration-slow: 250ms;
|
||||
--ease-default: cubic-bezier(0.25, 0.1, 0.25, 1.0);
|
||||
--ease-in-out: cubic-bezier(0.45, 0.05, 0.55, 0.95);
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
:root {
|
||||
--duration-fast: 0ms;
|
||||
--duration-normal: 0ms;
|
||||
--duration-slow: 0ms;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user