Merge claude/design-tokens-build: design tokens (tokens.css, tailwind.css, ipal-tokens)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-29 14:14:17 +01:00
co-authored by Claude Opus 5.5
44 changed files with 2277 additions and 101 deletions
+6
View File
@@ -30,6 +30,12 @@ following the hint (PROGRAMISTA §2) — do not ask whether it is needed. The on
a client decision recorded in `AGENTS.md` as `ipal-audit-skip: <keys> — <reason>` (keys
in AGENT.md §0b). Never add that line yourself just to make the audit pass.
## Design tokens (AGENT.md §6.11)
The script checks: hex in classes and inline styles (error), `dark:` on colour utilities and `var(--color-…)` in
classes (warnings), `styles.css` without `@intecion/ipal-kit/tokens.css` (warning — a site not yet migrated),
next/font in `--font-body` with the preset (warning), and with `src/design/tokens.ts`: no `DESIGN.md` (warning) and
`ipal-tokens --check` — a stale `src/design/tokens.css` or a WCAG AA contrast failure is an error.
## What the script does not check (do it by hand)
- **Editor test** (AGENT.md §11): every text, image, button, section,
@@ -152,6 +152,15 @@ if [ -n "$UI" ]; then
report ERROR "hex colors in classes" "§6.11 use design tokens (bg-primary…)" \
"$(g '(bg|text|border|from|to|via|fill|stroke)-\[#' $UI --include=*.tsx)"
report WARNING "dark: on colour utilities" "§6.11 the --ipal-* roles switch with the theme — bg-surface/text-fg, no dark:bg-…" \
"$(g '\bdark:(hover:|focus:)?(bg|text|border|from|to|via|fill|stroke|ring|outline)-' $UI --include=*.tsx)"
report WARNING "old colour variables in classes" "§6.11 use the preset utilities (bg-primary, text-fg) — not var(--color-…)" \
"$(g '\[var\(--color-' $UI --include=*.tsx)"
report ERROR "hex colors in inline styles" "§6.11 use design tokens — IPAL_TOKENS / ipalVar() for a dynamic style" \
"$(g "style=\{\{[^}]*['\"]#[0-9a-fA-F]{3,8}['\"]" $UI --include=*.tsx)"
report ERROR "barrel index.ts" "§6.12 import files directly" \
"$(find $UI -name 'index.ts' 2>/dev/null)"
@@ -162,6 +171,26 @@ if [ -n "$UI" ]; then
done
fi
# --- Design tokens (§6.11, design-tokens.md) ---
STYLES=$(find src/app -name 'styles.css' -not -path '*/node_modules/*' 2>/dev/null | head -1)
if [ -n "$STYLES" ]; then
report WARNING "design-token standard not wired" "§6.11 styles.css imports @intecion/ipal-kit/tokens.css + tailwind.css + ../../design/tokens.css" \
"$(grep -q 'ipal-kit/tokens.css' "$STYLES" || echo "$STYLES: no @import \"@intecion/ipal-kit/tokens.css\"")"
report WARNING "next/font in the Tailwind font slot" "§6.11 next/font variable '--font-family-body' / '--font-family-heading' (--font-body cycles with the font-body utility)" \
"$(grep -q 'ipal-kit/tailwind.css' "$STYLES" && g "variable: ['\"]--font-(body|heading|mono)['\"]" src/app --include=*.ts --include=*.tsx)"
fi
if [ -f src/design/tokens.ts ]; then
[ -f DESIGN.md ] || report WARNING "no DESIGN.md" "§6.11 the brand is described in DESIGN.md (template: ipal-setup/resources/DESIGN.md)" "DESIGN.md missing"
TOKENS_BIN=node_modules/@intecion/ipal-kit/bin/ipal-tokens.mjs
if [ -f "$TOKENS_BIN" ]; then
TOKENS_OUT=$(node "$TOKENS_BIN" --check 2>&1)
[ $? -ne 0 ] && report ERROR "ipal-tokens --check" "§6.11 run pnpm exec ipal-tokens: the CSS is stale or a contrast pair fails WCAG AA" \
"$(printf '%s\n' "$TOKENS_OUT" | grep -E '✗|out of date|ipal-tokens:' || echo 'ipal-tokens --check failed')"
else
report WARNING "ipal-tokens not installed" "§6.11 @intecion/ipal-kit 1.15+ ships the ipal-tokens bin" "$TOKENS_BIN missing"
fi
fi
# --- Collections (§5.3) ---
if [ -d src/collections ]; then
report ERROR "forbidden collection" "§5.3 settings/nav/footer are globals; FAQ/hero are blocks" \
+3 -1
View File
@@ -63,7 +63,9 @@ File patterns (Hero, FeatureGrid + FeatureCard): `resources/section-code.md`.
2. `src/blocks/<Name>/Component.tsx` — named export, type from `@/payload-types`
(`<Name>Block & { locale: string }`), structure:
`<Section settings>` → `<SectionHeader header>` → content with `<Media>`, `<CMSLink>`,
`items.map(<Card/>)`. No text, `href`, `<img>`, hex colors or inline SVG.
`items.map(<Card/>)`. No text, `href`, `<img>`, hex colors or inline SVG. Styles only through the design-token
utilities (`bg-surface`, `text-fg`, `rounded-card`, `py-section` — AGENT.md §6.11, design-tokens.md); no `dark:` for
colours; a different look per brand = a value in `src/design/tokens.ts`, never a change here.
3. Subcomponents go in the same folder; shared by 2+ sections → `src/components/ui/`.
An image the visitor can enlarge (gallery, card, product, certificate) → wrap the `<Media>` in
`<LightboxTrigger group={`<name>-${id}`} image={lightboxImage(item.image, { size: 'hero' })}>`
@@ -81,10 +81,12 @@ export async function CMSLink({ link, locale, className, children }: Props) {
```ts
import type { LinkAppearance } from '@intecion/ipal-kit'
// design-token utilities only (design-tokens.md) — a brand changes src/design/tokens.ts, never this file
const BASE = 'inline-flex items-center gap-2 rounded-control px-5 py-2.5 font-medium transition-colors duration-fast ease-out'
const VARIANTS: Record<LinkAppearance, string> = {
primary: 'btn btn-primary',
secondary: 'btn btn-secondary',
link: 'link-arrow',
primary: `${BASE} bg-primary text-on-primary hover:bg-primary-hover`,
secondary: `${BASE} bg-secondary text-on-secondary hover:bg-secondary-hover`,
link: 'text-link underline-offset-4 hover:text-link-hover hover:underline',
}
export function buttonClass(appearance: LinkAppearance): string {
@@ -135,18 +137,21 @@ import type { ReactNode } from 'react'
import type { SectionSettings } from '@/payload-types'
const BACKGROUNDS: Record<NonNullable<SectionSettings['background']>, string> = {
default: 'bg-background',
muted: 'bg-muted',
inverted: 'bg-foreground text-background',
default: 'bg-bg text-fg',
muted: 'bg-surface-muted text-fg',
inverted: 'bg-inverse',
}
export function Section({ settings, children }: { settings?: SectionSettings | null; children: ReactNode }) {
const background = settings?.background ?? 'default'
return (
<section
id={settings?.anchor || undefined}
className={`py-16 md:py-24 ${BACKGROUNDS[settings?.background ?? 'default']}`}
// inverse: the tokens inside are re-mapped, so cards/links keep text-fg, text-link (design-tokens.md)
data-surface={background === 'inverted' ? 'inverse' : undefined}
className={`py-section ${BACKGROUNDS[background]}`}
>
<div className="container">{children}</div>
<div className="mx-auto max-w-container px-gutter">{children}</div>
</section>
)
}
@@ -159,10 +164,10 @@ import type { SectionHeaderData } from '@/payload-types'
export function SectionHeader({ header, as: H = 'h2' }: { header?: SectionHeaderData | null; as?: 'h1' | 'h2' }) {
if (!header?.heading && !header?.eyebrow && !header?.intro) return null
return (
<header className="mb-10 max-w-2xl">
{header.eyebrow && <p className="eyebrow">{header.eyebrow}</p>}
{header.heading && <H className="heading">{header.heading}</H>}
{header.intro && <p className="lead">{header.intro}</p>}
<header className="mb-stack max-w-measure">
{header.eyebrow && <p className="mb-2 text-sm font-medium text-fg-muted">{header.eyebrow}</p>}
{header.heading && <H className={H === 'h1' ? 'text-h1' : 'text-h2'}>{header.heading}</H>}
{header.intro && <p className="mt-4 text-lead">{header.intro}</p>}
</header>
)
}
@@ -251,7 +256,7 @@ buildSectionSettingsField(),
// src/blocks/FeatureGrid/FeatureCard.tsx
export function FeatureCard({ item, locale }: { item: FeatureItem; locale: string }) {
return (
<article className="card">
<article className="flex flex-col gap-4 rounded-card border border-border bg-surface p-6 shadow-sm">
<Media resource={item.media} sizes="(min-width: 1024px) 33vw, 100vw" />
<h3>{item.heading}</h3>
{item.text && <p>{item.text}</p>}
@@ -265,7 +270,7 @@ export function FeatureGrid({ header, items, links, settings, locale }: FeatureG
return (
<Section settings={settings}>
<SectionHeader header={header} />
<div className="grid gap-6 md:grid-cols-3">
<div className="grid gap-gap md:grid-cols-3">
{items?.map((item) => <FeatureCard key={item.id} item={item} locale={locale} />)}
</div>
{links?.map(({ id, link }) => <CMSLink key={id} link={link} locale={locale} className="mt-10" />)}
@@ -315,30 +320,23 @@ components. **Never** SVG pasted into a section's JSX.
## Style
- **Tailwind in components**, colors and fonts as **tokens** in `styles.css`
(`@theme`) — the source is `DESIGN.md` (Impeccable). Components use only token
names (`bg-primary`, `text-foreground`), **never** `bg-[#ff6600]` or hex.
- Map the plugin tokens to the project tokens — one brand color in one place.
- Fonts via `next/font` in the layout, wired to `@theme` with a CSS variable.
The design-token standard (`node_modules/@intecion/ipal-kit/docs/design-tokens.md`, AGENT.md §6.11):
- **Components use only the preset's utilities** — `bg-bg`, `bg-surface`, `bg-surface-muted`, `bg-inverse`, `text-fg`,
`text-fg-strong`, `text-fg-muted`, `text-on-primary`, `border-border`, `text-link`, `outline-focus`, `text-h1`…,
`py-section`, `px-gutter`, `gap-gap`, `rounded-control`, `rounded-card`, `shadow-sm`, `max-w-container`.
**Never** hex, `bg-[#ff6600]`, `var(--color-…)`, or `dark:` for colours (the roles switch with the theme).
- The brand is `src/design/tokens.ts` → `pnpm exec ipal-tokens` → `src/design/tokens.css`; `DESIGN.md` describes it.
- Fonts via `next/font` with `variable: '--font-family-body'` / `'--font-family-heading'` on `<html>`.
- No CSS Modules and no `style={{…}}` — exception: a dynamic value from data.
- Visual variants → `Record<Variant, string>` (§6.3), not ternary chains.
```css
/* src/app/(frontend)/styles.css */
/* src/app/(frontend)/styles.css — the same on every site */
@import "tailwindcss";
@import "@intecion/ipal-kit/fluid-wide.css";
@import "@intecion/ipal-kit/tokens.css";
@import "@intecion/ipal-kit/tailwind.css";
@import "../../design/tokens.css"; /* generated by ipal-tokens from src/design/tokens.ts */
@source "../../../node_modules/@intecion/ipal-kit/dist/**/*.js";
@theme {
--color-primary: oklch(0.62 0.19 45);
--color-background: oklch(0.99 0 0);
--color-foreground: oklch(0.2 0 0);
--color-muted: oklch(0.96 0 0);
--font-sans: var(--font-body); /* next/font: variable '--font-body' */
}
:root {
--ipal-primary: var(--color-primary); /* cookie banner, Turnstile = brand color */
--ipal-radius: 0.75rem;
}
```
+2 -1
View File
@@ -189,7 +189,8 @@ Mandatory set: AGENT.md §0b, skill **ipal-setup**; checks: **ipal-audit**, **ip
| page templates | `scripts/seed-content.ts` | `pageTemplates.home({ blocks: libraryBlockSlugs(blockOptions) })`, `pageTemplates.contact({ form: { $form: 'Contact form' } })` (`/templates`); after launch only with `SEED_ONLY` | seed summary 0 errors | block-library.md, seeding.md |
| FAQ rich results | page route | `getPageJsonLd(locale, slug, { faq: faqItemsFromLayout })` | Rich Results Test → FAQPage | block-library.md, seo.md |
| languages in the header | header | `<LanguageSwitcher>` (`/client`), `<AlternateLinksUpdater>` | switches to `/en/<slug-en>` | i18n.md |
| Tailwind | `styles.css` | `@import "@intecion/ipal-kit/fluid.css";` + `@source "…/node_modules/@intecion/ipal-kit/dist/**/*.js";` | the cookie banner is styled | PROGRAMISTA §2.5 |
| Tailwind + design tokens | `styles.css`, `src/design/tokens.ts`, `DESIGN.md` | `@import` `fluid-wide.css` (or `fluid.css`), `tokens.css`, `tailwind.css`, `../../design/tokens.css` + `@source "…/node_modules/@intecion/ipal-kit/dist/**/*.js";`; `pnpm exec ipal-tokens`; next/font `--font-family-body` / `--font-family-heading` | `ipal-tokens --check` up to date, no ✗ contrast rows; the cookie banner in the brand colour in both themes | design-tokens.md |
| a11y widget CSS | `styles.css` | `@import "@intecion/ipal-kit/a11y.css";` (only with `<AccessibilityWidget>`) | widget options change the page | accessibility.md |
| `/its` panel | `app/(payload)/its/…` | `adminRoute: '/its'` + `its` in the proxy matcher | `/its` login, `/admin` 404 | security.md |
| skills | `package.json` | `"ipal:skills": "ipal-skills"` | `.agents/skills/` up to date | PROGRAMISTA §2.1a |
| eject a library block | CLI | `pnpm exec ipal-blocks list` / `pnpm exec ipal-blocks eject faq [--dest src/blocks] [--dry-run]` → `src/blocks/Faq/`; then the ejected builder in `blockOptions`' place and `components: { faq: FaqBlock }` | the block renders from the project file | block-library.md "Own blocks and eject" |
@@ -1,7 +1,7 @@
# ipal-kit — export index
Every public export of `@intecion/ipal-kit` (all entries: root, `/client`, `/rsc`,
`/server`, `/seed`, `/next/middleware`, `/admin`, `/env`, `/blocks`, `/blocks/rsc`, `/templates`), grouped by module. Search with grep
`/server`, `/seed`, `/next/middleware`, `/admin`, `/env`, `/blocks`, `/blocks/rsc`, `/templates`, `/tokens`), grouped by module. Search with grep
(`grep -n "name" .agents/skills/ipal-reference/resources/api.md`) before you write anything yourself.
"Import from" column — the first entry is preferred. Plugin options, env, routes and what the
project wires: `../SKILL.md`. Module details: `node_modules/@intecion/ipal-kit/docs/<page>.md`.
@@ -739,6 +739,30 @@ Most routes and metadata are already ready in `createContentHelpers` (`generateP
**Types:** `ThemeOptions` (root, `ipalKit({ theme })`), `Theme`, `ThemeSetting`, `ThemeConfig` (root, `/client`) — theme, setting from the panel and theme options; `ThemeScriptProps` (`/rsc`), `ThemeSwitcherProps`, `ThemeSwitcherClassNames` (`/client`) — component props.
## Design tokens (`tokens`) — details: `node_modules/@intecion/ipal-kit/docs/design-tokens.md`
CSS: `@intecion/ipal-kit/tokens.css` (neutral `--ipal-*` defaults, light/dark, `[data-surface="inverse"]`), `@intecion/ipal-kit/tailwind.css`
(Tailwind 4 preset: `bg-surface`, `text-fg`, `py-section`…), `@intecion/ipal-kit/a11y.css` (widget CSS). Bin: `ipal-tokens`
(`src/design/tokens.ts` → `src/design/tokens.css`, WCAG contrast; `--check`, `--report`, `--warn-only`, `--in`, `--out`).
``@intecion/ipal-kit/tokens`` imports nothing from Payload/React — safe in `src/design/tokens.ts`, `next/og`, e-mail templates.
| Export | Import from | What it does / when |
|---|---|---|
| `defineTokens(input)` | `@intecion/ipal-kit/tokens`, `@intecion/ipal-kit` | The brand in `src/design/tokens.ts`; checks every role/size name, returns the input. |
| `tokensToCss(input, { source? })` | `@intecion/ipal-kit/tokens` | The brand CSS (`ipal-tokens` writes it): only what differs from the defaults. |
| `defaultTokensCss()` | `@intecion/ipal-kit/tokens` | The content of `tokens.css`. |
| `contrastReport(input?)` | `@intecion/ipal-kit/tokens` | WCAG rows (`ContrastRow`) for every text/surface pair in both themes and the inverse scope. |
| `contrastRatio(fg, bg)`, `parseColor(css, lookup?)` | `@intecion/ipal-kit/tokens` | Colour maths for your own checks (hex, rgb, hsl, oklch, `color-mix(in oklch)`, `var()`). |
| `resolveColors(input)` | `@intecion/ipal-kit/tokens` | Final colour values per theme — for `next/og`, e-mail, `theme-color`. |
| `fluidClamp(min, max, range?)` | `@intecion/ipal-kit/tokens` | The fluid.css `clamp()` for your own sizes; `FLUID_SCALE` (the shipped pairs), `FLUID_RANGES` (`standard` 360→1280, `wide` 360→1920). |
| `IPAL_TOKENS` | `@intecion/ipal-kit/tokens`, `@intecion/ipal-kit` | Every token as `var(--ipal-…)`, keyed by name: `IPAL_TOKENS.primary`. |
| `ipalVar(name, fallback?)` | `@intecion/ipal-kit/tokens`, `@intecion/ipal-kit` | `var(--ipal-<name>[, fallback])`. |
| `IPAL_BREAKPOINTS` | `@intecion/ipal-kit/tokens`, `@intecion/ipal-kit` | `{ sm: 40, md: 48, lg: 64, xl: 80, '2xl': 96 }` (rem) — for `sizes=` / `matchMedia`. |
| `COLOR_DEFAULTS`, `STATIC_DEFAULTS`, `FLUID_TOKENS`, `INVERSE_SCOPE`, `LEGACY_DARK_ROLES` | `@intecion/ipal-kit/tokens` | The catalogue: colour defaults per theme, theme-independent defaults, fluid names, inverse re-map, the old `-dark` twins. |
| `DARK_SELECTOR`, `INVERSE_SELECTOR` | `@intecion/ipal-kit/tokens` | `:root[data-theme="dark"]`, `[data-surface="inverse"]`. |
**Types:** `TokensInput`, `IpalTokenName` (root, `/tokens`), `ColorInput`, `ColorRole`, `ContrastRow`, `FluidRange`, `RemValue` (`/tokens`).
## Turnstile (`turnstile`) — details: `node_modules/@intecion/ipal-kit/docs/turnstile.md`
| Export | Import from | What it does / when |
+22 -17
View File
@@ -266,30 +266,35 @@ from the title, noindex in the sidebar, an AI summary field; changing the slug a
`buildOptimizeUploadHook({…})`; the bare function instead of the hook (`normalizeFilename`). `buildRevalidateHook`
refreshes collections only (globals — stage 3; archive entries — your own hook, hooks.md).
## 5. Styles
## 5. Styles — the design-token standard
**Code.** `postcss.config.mjs`: `export default { plugins: { '@tailwindcss/postcss': {} } }`.
**Code.** `postcss.config.mjs`: `export default { plugins: { '@tailwindcss/postcss': {} } }`. Copy the two templates:
`.agents/skills/ipal-setup/resources/DESIGN.md` → `DESIGN.md` (project root; fill it from the stage 0 answers) and
`.agents/skills/ipal-setup/resources/tokens.ts` → `src/design/tokens.ts` (brand values from `DESIGN.md`: primary,
secondary/accent, theme, radius, fonts). Then `pnpm exec ipal-tokens` → `src/design/tokens.css` (commit both).
```css
/* src/app/(frontend)/styles.css */
/* src/app/(frontend)/styles.css — the same on every site, no brand values here */
@import "tailwindcss";
@import "@intecion/ipal-kit/fluid.css"; /* or fluid-wide.css (up to 1920 px) — one of the two */
@import "@intecion/ipal-kit/fluid-wide.css"; /* default; fluid.css = stops at 1280 px */
@import "@intecion/ipal-kit/tokens.css"; /* neutral defaults for every --ipal-* token */
@import "@intecion/ipal-kit/tailwind.css"; /* utilities (bg-surface, text-fg, py-section…), dark: on data-theme */
@import "../../design/tokens.css"; /* the brand, generated by ipal-tokens — always last */
@source "../../../node_modules/@intecion/ipal-kit/dist/**/*.js"; /* without this the banner/Turnstile have no styles */
@theme inline {
--text-display: var(--ipal-fs-display); --text-h1: var(--ipal-fs-h1); --text-h2: var(--ipal-fs-h2);
--text-h3: var(--ipal-fs-h3); --text-lead: var(--ipal-fs-lg);
--spacing-section: var(--ipal-space-section); --spacing-gutter: var(--ipal-space-gutter); --spacing-gap: var(--ipal-space-gap);
}
@theme { /* colors, fonts, radii from DESIGN.md (none → ask about Impeccable or use neutral tokens) */ }
:root { --ipal-primary: var(--color-primary); --ipal-radius: 0.5rem; /* numbers from DESIGN.md: --ipal-fs-h1: clamp(…) */ }
```
Fonts via `next/font` with `subsets: ['latin', 'latin-ext']`, a CSS variable wired in `@theme` and on `<html>`
(AGENT.md §6.11, example in section-code.md → "Styles"). Hero on `--ipal-hero-min-h` (§6.11a).
Fonts via `next/font` with `subsets: ['latin', 'latin-ext']` and `variable: '--font-family-body'` /
`'--font-family-heading'`, both classes on `<html>` (design-tokens.md → Wiring). Hero on `--ipal-hero-min-h` (§6.11a).
Optional (only when the site shows the a11y widget): `@import "@intecion/ipal-kit/a11y.css";`.
**Check.** After stage 6: on `/pl` the `text-h1`/`py-section` classes work, the cookie banner is styled (color
`--ipal-primary`), Polish characters render in the font; screens 360, 768, 1366×768, 1920 without horizontal scroll.
**Check.** `pnpm exec ipal-tokens` exits 0 (no ✗ contrast rows) and `pnpm exec ipal-tokens --check` says up to date;
paste `pnpm exec ipal-tokens --report` into `DESIGN.md` → Colour. After stage 6: on `/pl` the `text-h1`/`py-section`/
`bg-surface` classes work, `getComputedStyle(document.documentElement).getPropertyValue('--ipal-primary')` is the brand
colour, switching the theme changes `--ipal-bg`, the cookie banner uses the brand colour in both themes, Polish characters
render in the font; screens 360, 768, 1366×768, 1920 without horizontal scroll.
**Turn off / override.** `fluid*.css` is optional (your own scale = overridden variables in `:root`; never write the formulas from
scratch); plugin components: `--ipal-*` tokens (each with a `-dark` variant) and `classNames` (consent.md).
**Turn off / override.** Every file is optional: no `tokens.ts` = the neutral defaults; plain CSS without Tailwind =
`tokens.css` alone and `var(--ipal-…)`; `fluid*.css` optional. Any value: `tokens.ts` (`raw: { … }` for tokens without a
field) or CSS after the imports; project-only decorative colours below the imports + `DESIGN.md` → Deviations. Plugin
components also take `classNames` (consent.md). Full list of tokens and utilities: design-tokens.md.
## 6. Routing — proxy, data layer, layout, catch-all, 404
@@ -0,0 +1,48 @@
# DESIGN.md — <client name>
The human source of the look. Its machine form is `src/design/tokens.ts`; the two must agree
(`ipal-doctor` compares them). Values go into `tokens.ts`, never into components.
Sections are fixed: fill every one, write "default" where the brand keeps the standard.
## 1. Brand in one sentence
<what the site is, for whom, the feeling>. Audience: <…>.
The one memorable element (where the boldness goes): <…>. Everything else stays quiet.
## 2. Colour
| Role (`--ipal-*`) | Light | Dark | Used for |
|---|---|---|---|
| primary | oklch(…) | (carried over) | main buttons, key accents |
| secondary | default | default | second button |
| accent | default (= primary) | | badges, highlights |
| bg / surface / surface-muted | default | default | page, cards, alternate sections |
Contrast (paste `pnpm exec ipal-tokens --report`; every ✗ fixed before launch):
```
<report>
```
## 3. Type
Body: <family> <weights> (`--font-family-body`). Headings: <family> <weight> (`--font-family-heading`).
Max 2 families × 2–3 weights, `subsets: ['latin', 'latin-ext']`. Scale overrides (`fs`): <none | h1 2.25→4rem …>.
Heading style: <case, tracking, weight>.
## 4. Shape and depth
Radius: control <…>, card <…>, media <…>. Depth: <borders | shadow-sm on cards | none>.
## 5. Layout
Scale: fluid-wide (default) | fluid. Container <80rem>, narrow <48rem> (legal, articles), measure 68ch.
Section rhythm: py-section; compact bands py-section-sm. Alignment: <left | centred hero only>.
## 6. Motion
What moves and why (max one orchestrated moment): <…>. Durations: default (fast 150 / base 250 / slow 400 ms).
Reduced motion: every duration token is 0 ms; nothing essential is animated.
## 7. Imagery and icons
Photo style: <…>. Focal points set in Media. Icons: lucide set, <stroke width>.
## 8. Theme
<light only | dark only | both>, default <light | dark | system> (Site settings → Theme), toggle <yes | no>.
## 9. Deviations from the standard
Every override of a default, and every project-only token or breakpoint, with the reason:
- <none>
@@ -0,0 +1,27 @@
// src/design/tokens.ts — the ONLY file you edit to rebrand the site (docs/design-tokens.md).
// After every change: `pnpm exec ipal-tokens` → writes src/design/tokens.css (commit it) and prints
// the WCAG contrast check (`--report` prints every pair for DESIGN.md → Colour).
// Leave out anything the brand does not change: the neutral defaults in @intecion/ipal-kit/tokens.css apply.
import { defineTokens } from '@intecion/ipal-kit/tokens'
export const tokens = defineTokens({
theme: 'both', // 'light' | 'dark' | 'both' — must match Site settings → Theme
fluid: 'wide', // the fluid file styles.css imports: 'wide' = fluid-wide.css (default), 'standard' = fluid.css
color: {
light: {
primary: 'oklch(0.5 0.17 250)', // [TO FILL: brand colour from DESIGN.md]
// secondary: 'oklch(…)', accent: 'oklch(…)', bg: 'oklch(…)', surface-muted: 'oklch(…)'
},
dark: {
// primary carries over from light when left out; set a lighter one if the report fails
},
},
font: {
// next/font in the root layout: variable '--font-family-body' / '--font-family-heading' on <html>
fwHeading: 650,
},
radius: { control: '0.5rem', card: '0.75rem' },
// fs: { h1: ['2.25rem', '4rem'] }, // min → max; the clamp() is computed for the fluid range
// space: { section: ['3rem', '8rem'] },
// container: { default: '80rem' },
})
+5 -3
View File
@@ -116,9 +116,11 @@ title/description of every page (≤ 60 / ≤ 155 characters, unique); `aiSummar
keep the auto-fill or fix it when the summary is weak.
## Phase 8 — Design
`DESIGN.md` exists → tokens in `@theme`. None → neutral tokens + an Impeccable
recommendation in the report. Do not polish styles ad hoc in components. Library blocks follow the tokens by
themselves (token utilities only); a part that needs another look → `createBlockRegistry({ classNames })`.
The design-token standard (AGENT.md §6.11, `design-tokens.md`): `DESIGN.md` exists → its values go into
`src/design/tokens.ts` (template `.agents/skills/ipal-setup/resources/tokens.ts`) → `pnpm exec ipal-tokens` (no ✗
contrast rows). None → copy the `DESIGN.md` template, keep the neutral defaults + the brand primary, and recommend
Impeccable in the report. Components use only the preset's utilities. Do not polish styles ad hoc in components. Library blocks follow the
tokens by themselves (token utilities only); a part that needs another look → `createBlockRegistry({ classNames })`.
Responsiveness: 360 px, 768 px, 1280 px — no horizontal scroll.
## Phase 9 — Verification (all by yourself, results go into the report)
+7
View File
@@ -186,6 +186,13 @@ at start. A project with its own separator options (`globalOverrides`): use valu
Check: `curl -s -X POST $URL/api/graphql -H 'content-type: application/json' -d '{"query":"{ SiteSetting { titleSeparator } }"}'` → 200,
and the browser tab shows the same separator.
Project code that reads `settings.titleSeparator` itself now gets a name: use `titleSeparatorChar()`.
**→ 1.15.0 design tokens (opt-in, design-tokens.md → "Migrating an existing site"):** nothing breaks without it. To adopt:
add the four `@import`s (§6.11) and `src/design/tokens.ts` (template `.agents/skills/ipal-setup/resources/tokens.ts`),
map the current `@theme` colours/fonts/radius onto the roles, keep the old names as aliases in a marked legacy
block, delete the `--ipal-*-dark` block kept only for the cookie banner, `pnpm exec ipal-tokens`, then replace old
utilities and `dark:` colour classes file by file (`ipal-audit` lists them) and remove the legacy block. next/font
variables become `--font-family-body` / `--font-family-heading`. Check: `ipal-tokens --check`, the site in both themes.
Only with the owner's decision ("Project decisions": which sites migrate when).
7. `pnpm ipal:skills` (new agent rules: architecture questions first, ipal-kit first). Optional with the owner's
consent: `pnpm exec ipal-skills --external`.