3.4 KiB
3.4 KiB
Visual Style Guide (T02)
Purpose
This document defines the Recipe Manager visual design tokens and how to apply them consistently across pages/components.
Primary source of truth:
frontend/src/theme.tsfrontend/src/index.css(CSS custom properties)frontend/tailwind.config.js(Tailwind token mapping)
1) Color Tokens
Brand + Semantic
colors.primary:#2563ebcolors.primaryDark:#1d4ed8colors.primaryLight:#dbeafecolors.accent:#9333eacolors.success:#15803dcolors.warning:#ca8a04colors.error:#dc2626
Surfaces + Text
colors.bg:#f4f7fbcolors.bgAlt:#edf2f7colors.surface:#ffffffcolors.surfaceMuted:#f8fafccolors.border:#dbe3efcolors.text:#1f2937colors.textHeading:#0f172acolors.textDim:#64748b
Usage
- Primary actions:
primary/primaryDarkfor hover. - Validation or status badges/alerts:
success,warning,errorwith light backgrounds where needed. - Use
surface+borderfor cards/forms. - Use
textHeadingfor section/page headings andtext/textDimfor body/supporting copy.
2) Typography Tokens
Families
- Sans:
typography.fontFamily.sans - Heading:
typography.fontFamily.heading - Mono:
typography.fontFamily.mono
Scale
xs0.75remsm0.875rembase1remlg1.125remxl1.25rem2xl1.5rem3xl1.875rem4xl2.25rem
Guidance
- Page titles:
3xl–4xl - Section titles:
xl–2xl - Body text:
base - Helper/meta text:
sm
3) Spacing Tokens
xxs0.25remxs0.5remsm0.75remmd1remlg1.5remxl2rem2xl2.5rem3xl3rem
Guidance
- Tight control spacing (chips/icons):
xxs–xs - Form controls/content clusters:
sm–md - Section/page spacing:
lg–2xl
4) Radius Tokens
xs0.375remsm0.5remmd0.75remlg1remxl1.25remfull9999px
Guidance
- Inputs/buttons:
md - Cards/containers:
lg - Pills/tags:
full
5) Shadow Tokens
shadows.subtle: low emphasis hover/elevationshadows.card: default card elevationshadows.hover: raised interactive stateshadows.focus: focus ring treatment
Guidance
- Prefer
cardfor panels/surfaces. - Use
subtlefor lightweight interactive surfaces. - Keep
hoverlimited to strong CTAs/cards.
6) Tailwind Mapping
Tailwind config maps tokenized CSS variables for:
colors(primary,accent,success,warning,error,surface,muted,border)fontFamilyfontSizespacingborderRadiusboxShadow
This keeps utility classes aligned with global tokens and avoids hardcoding values in component markup.
7) Implementation Notes (T02)
Updated to consume tokens where practical:
frontend/src/theme.ts: expanded token definitions and shareddesignTokensexport.frontend/src/index.css: added token-backed CSS variables (colors, type scale, spacing, radius, shadows).frontend/tailwind.config.js: switched extension values to CSS-variable/token-backed mappings.frontend/src/components/Toast.tsx: semantic status colors + radius/shadow from tokens.frontend/src/components/RecipeCard.tsx: recipe accent palette sourced from tokens.frontend/src/components/TagSelector.tsx: default tag color sourced from tokens.
Scope intentionally kept minimal/non-breaking to support upcoming visual tasks (T04–T07).