diff --git a/src/workflows/0-project-setup/templates/folder-guides/00-design-system.template.md b/src/workflows/0-project-setup/templates/folder-guides/00-design-system.template.md index 8bc8e2b45..ef2cd2ae6 100644 --- a/src/workflows/0-project-setup/templates/folder-guides/00-design-system.template.md +++ b/src/workflows/0-project-setup/templates/folder-guides/00-design-system.template.md @@ -97,7 +97,9 @@ Replace the table below with your system's spacing tokens. Any naming convention ### Option B: WDS default scale -Nine tokens, symmetric around `space-md`. Freya will propose pixel values during the first design session. +Nine tokens, symmetric around `space-md` (the baseline). Freya will propose pixel values during the first design session. + +`space-md` is to spacing what `text-md` is to typography — the default you reach for first. It's the gap between paragraphs, between form fields, between list items. Everything else is relative to it: `space-sm` is tighter, `space-lg` is more generous. | Token | Value | Use | |-------|-------|-----| @@ -105,13 +107,36 @@ Nine tokens, symmetric around `space-md`. Freya will propose pixel values during | space-2xs | — | Minimal spacing (badge padding, tight lists) | | space-xs | — | Tight spacing (within compact groups) | | space-sm | — | Small gaps (between related elements) | -| space-md | — | Default element spacing | +| **space-md** | — | **Default element spacing (the baseline)** | | space-lg | — | Comfortable spacing (card padding, form fields) | | space-xl | — | Section padding | | space-2xl | — | Section gaps | | space-3xl | — | Page-level breathing room | +### Optical adjustments + +Sometimes the math is right but the eye says it's wrong. A circular image leaves white corners, a light element on a light background looks more spaced than it is. When this happens, use token math — not raw pixels: + +``` +space-lg - space-3xs → "standard spacing, pulled in by a hairline" +space-xl + space-2xs → "section padding, nudged out slightly" +``` + +In page specs, always annotate why: + +| Padding top | **space-lg - space-3xs** (optical: circular image adds perceived whitespace) | + +**Rules:** +- Adjustments always use token math: `base ± correction` +- Always annotate the reason — future readers need to know this wasn't a mistake +- If adjusting by more than one step, the base token is probably wrong — reconsider + +In CSS: `calc(var(--space-lg) - var(--space-3xs))` + + +Spacing objects are first-class — they have IDs in page specs (e.g., `hem-heading-subtitle-gap`) and live here organized by value. Each spacing value accumulates the situations where it's used. The list grows from real design decisions. + +_Patterns will be documented here as spacing objects recur across pages._ + + + +--- + ## Components _Components will be documented here as patterns emerge across scenarios._ diff --git a/src/workflows/4-ux-design/data/guides/DESIGN-LOOP-GUIDE.md b/src/workflows/4-ux-design/data/guides/DESIGN-LOOP-GUIDE.md index 1dd6610e3..017e25de4 100644 --- a/src/workflows/4-ux-design/data/guides/DESIGN-LOOP-GUIDE.md +++ b/src/workflows/4-ux-design/data/guides/DESIGN-LOOP-GUIDE.md @@ -98,6 +98,8 @@ space-3xs space-2xs space-xs space-sm space-md space-lg space-xl space-2x - If a spacing value isn't in the scale, it doesn't belong in the spec - The scale can be adjusted as the project matures — specs stay valid because they reference names, not numbers +**Optical adjustments:** Sometimes the math is right but the eye says it's wrong — a circular image leaves white corners, a light element looks more spaced than it is. Use token math: `space-lg - space-3xs` (not raw pixels). Always annotate the reason. If adjusting by more than one step, the base token is probably wrong. + --- ## Tool Roles @@ -144,6 +146,26 @@ Once design tokens exist (step 9), use token names: This builds shared vocabulary. Over time, the user learns to say "change from space-md to space-lg" instead of "add more space." +### Pattern recognition — reflect, don't interrogate + +When the user requests a spacing adjustment, the agent's job is to **observe and reflect** — not to ask "why?" A trained designer carries spacing patterns unconsciously. Their gut says "more space here" because a pattern is firing in the back of their brain. The agent externalizes that intuition. + +**Wrong:** "Why does this need more space?" — breaks the flow, puts the meta-work on the designer. + +**Right:** "Got it — large image above a card row needs extra breathing room. I'll use space-xl + space-xs for this relationship going forward." + +The designer nods or corrects. The agent records it. The pattern table in the design system builds itself as a byproduct of doing the work. + +**The process:** +1. User says "more space between the photo and the cards" +2. Agent fixes it: `space-lg + space-xs` +3. Agent reflects: "So when an image-with-text block sits above a card row, the default gap isn't enough." +4. First time: one-off adjustment noted in the page spec +5. Second time: agent says "this is the same pattern as the homepage about section — applying it" +6. Third time: agent extracts it to `D-Design-System/00-design-system.md` → Patterns + +This is how a designer's unconscious expertise becomes a shared, reusable asset. The agent does the tedious classification and recall work. The designer just keeps designing. + --- ## When to Use This Loop diff --git a/src/workflows/4-ux-design/templates/page-specification.template.md b/src/workflows/4-ux-design/templates/page-specification.template.md index 44cc54672..d7f179d73 100644 --- a/src/workflows/4-ux-design/templates/page-specification.template.md +++ b/src/workflows/4-ux-design/templates/page-specification.template.md @@ -152,6 +152,38 @@ | EN | "{English text}" | | Behavior | {onClick / onChange / etc.} | +#### ↕ `{page-name}-{above}-{below}-gap` — {spacing token} + + + +--- + +#### {Object Name 2} + +**OBJECT ID:** `{page-name}-{object-name-2}` + +| Property | Value | +|----------|-------| +| Component | [{Component}]({path}) | +| Translation Key | `{translation.key}` | +| SE | "{Swedish text}" | +| EN | "{English text}" | + --- #### {Group Name} (Container) @@ -175,6 +207,8 @@ | SE | "{Swedish text}" | | EN | "{English text}" | +##### ↕ `{page-name}-{group-name}-{obj1}-{obj2}-gap` — {spacing token} + ##### {Object in Group 2} **OBJECT ID:** `{page-name}-{group-name}-{object-2}`