Nieuwe tokens (brand, inv, panel, field, prog, body), Archivo als lettertype (Sora en Instrument Sans verwijderd), witte toggles op het rode kopblok, en tests voor structuur, landmarks en contrast in alle vier de thema's. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
7.4 KiB
Code Generation Plan — b-modern-sections (U2)
Single source of truth for U2 Code Generation. Inputs: unit-of-work.md (U2), requirements FR-1, NFR-1, NFR-2, execution plan (Functional Design, NFR and Infrastructure skipped for U2: the design exists in the Claude Design canvas, Modern.dc.html = B), U1 summary (construction/theme-foundation/code/summary.md).
Unit context
- Scope: nav, hero, Over, Werkwijze, footer and the frame of the contact block in design B, light and dark, responsive 360px–1440px+. Not in U2: the packages block (U3: the existing
PackagesSectionstays as is, only inheriting tokens and font) and the contact form (U4: the panel inside the contact block shows the existing mailto call-to-action until then). - Workspace root:
K:\Development\SlpSoftware\Projects\SlpSoftware; modify in place. Branchfeature/redesign-modern-timetravel; one commit for U2; no push. - Dependencies: U1 (variant × mode tokens, toggles). Blocks: U3, U4 (frames).
- Requirement mapping: FR-1 (design B), NFR-1 (WCAG AA, landmarks, focus, reduced motion), NFR-2 (responsive), NFR-7.
Design decisions taken from the canvas (and where content stays leading)
- Layout/typography as in
Modern.dc.html: Archivo Variable with width axis (font-stretch112–125%, weights 800–900), max width 1280px, section paddings 128–152px (smaller on mobile), square corners (no rounded cards), flat colour blocks. - Colour blocks: hero and contact sit on the constant brand red
#7A1414in light and dark mode (as in the canvas), black strips (inv) for the code line, Werkwijze and footer. New semantic tokens (all four variant×mode sets):--color-brand,--color-on-brand,--color-body,--color-inv,--color-panel,--color-field,--color-prog; Tailwind namesbrand,on-brand,body,inv,panel,field,prog. E gets matching values (brand #AC0000). - Text stays leading (decision in requirements): body texts come from
content.ts(the November text update). Where the design shows a different wording ("Maatwerk van SLP Software ... ik bouw het allemaal" vs the live "wij bouwen"), the live copy wins. Only structural additions are new content fields:heroContent.displayHeading = ['Websites,', 'apps', '& meer.'](display headline from the design; the live eyebrow "Web & .NET development" moves to the code strip),aboutFacts(3 facts: Direct contact / Eén werkdag / Vaste prijs, from the design),processSteps[].phase(Intake / Bouwen / Live),contactInfo.displayHeading = ['Klaar om', 'te bouwen?']. - Nav: part of the hero header (not sticky, as in the design), white text on brand; the CTA "Start project" as white block; both toggles as white outlined circles (
tone="onBrand"prop). The existing mobile menu (hamburger) is kept for small screens (better than wrapping links); years are not in the menu. - Over: rectangular 3:4 photo with the offset brand block (real photo with the existing WebP/JPG variants), h2, two paragraphs, three-fact list.
- Werkwijze: black section, three steps with progress bar (33/66/100%), large outlined numbers (
-webkit-text-stroke), phase, title, text; fixed<ol>. - Contact frame: brand block, display heading, intro, mailto link, and a panel (
panelcolour) that contains the mailto button for now; U4 replaces the panel content with the form. - Reduced motion: caret animation off (existing rule), no hover motion that moves layout.
Steps
- Step 1 — Tokens: extend
src/index.css(four sets) andtailwind.config.ts(colors,fontFamily.sans/display→ Archivo Variable, keepmono); remove the Sora and Instrument Sans imports fromsrc/fonts.tsand the two packages frompackage.json(pnpm remove), keep JetBrains Mono and Archivo. Check contrast pairs in a small test (ratios computed from the token values: text/bg, muted/bg, on-brand/brand, accent/bg in both modes ≥ 4.5:1; large text ≥ 3:1). - Step 2 — Content: add the structural fields to
src/features/landing/data/content.ts(types + values), without changing existing copy. - Step 3 — Toggles: add a
tone?: 'default' | 'onBrand'prop toModeToggleandVariantToggle(white outline/text variant for use on the brand block); defaults unchanged. - Step 4 — Shell: rewrite
Nav.tsx(header band with nav; mobile menu kept; anchors without years),Hero.tsx(display headline, lead, two buttons, black code strip with caret),Footer.tsx(black strip);RootLayout.tsxplaces the hero header (nav + hero) inside the B shell as designed (Nav is rendered byHero's header wrapper or as sibling with the same brand background: decided in code, tested by landmarks). - Step 5 — Sections: rewrite
AboutSection.tsx,ProcessSection.tsx,ProcessStep.tsx,ContactSection.tsxas described;PackagesSection.tsxuntouched except removing classes that no longer exist if any (verify visually via tests only). - Step 6 — Tests: Vitest + Testing Library: nav (links without years, CTA, both toggles with onBrand styling, mobile menu), hero (headline parts, lead from content, code line, buttons link to
#pakkettenand#contact), about (heading, paragraphs from content, three facts, photo alt), process (ordered list of three steps, progress bars, numbers aria-hidden, phase/title/text), contact frame (heading parts, mailto link, panel with the mailto button), footer; landmarks (header,nav aria-label,main,footer, oneh1, heading order), contrast test from Step 1. UpdateNav.test.tsx. - Step 7 — Build and test (automatic, Step 13.5):
pnpm lint,pnpm test,pnpm build; fix and retry until green; report real counts. No manual browser check can be done by the AI in this environment; screenshots/visual check by the user at review time. - Step 8 — Docs:
construction/b-modern-sections/code/summary.md(files, decisions, copy deviations from the canvas, hand-offs for U3/U4/U5). - Step 9 — Commit: one commit (Dutch message,
Co-Authored-By), no push.
Files (M modify, C create, D delete)
M src/index.css, tailwind.config.ts, src/fonts.ts, package.json, pnpm-lock.yaml, src/features/landing/data/content.ts, src/components/ui/{ModeToggle,VariantToggle}.tsx, src/components/layout/{Nav,Footer,RootLayout}.tsx, src/features/landing/components/{Hero,AboutSection,ProcessSection,ProcessStep,ContactSection}.tsx, tests; C src/test/contrast.ts (helper) and new test files under the touched folders; D none.
Explicitly NOT touched in U2
PackagesSection, PackageCard, PackageCardSkeleton, usePackagesQuery (U3); the contact form and cms-client (U4); anything in src/variants/e beyond using the toggles (U5); router, Sentry, Umami.
Risks
- The canvas hero headline ("Websites, apps & meer.") differs from the live H1 ("SLP software: websites, apps & meer"); treated as a display headline decision of the design, flagged in the summary so the user can revert it in one line.
- The package block keeps its old look until U3 and may look out of place between the new sections; accepted because units are not deployed separately.
- Visual fidelity cannot be screenshot-verified by the AI here; tests cover structure, text, links, landmarks and contrast.
Traceability
FR-1, NFR-1, NFR-2, NFR-7; canvas Modern.dc.html (+ ModernDark); U1 token model; Security Baseline: no new external requests (fonts self-hosted), no inline scripts.