Design tokens: docs, agent guide, skills, audit checks
- docs/design-tokens.md (new module page), README index, CHANGELOG - AGENT.md §0b row 19, §6.11 rewritten for the standard, §6.11a, §7, §10, §12, §14 - ipal-setup stage 5, ipal-block section-code (Section with data-surface, Button, card on token utilities), ipal-site phase 8, ipal-reference (+ api.md /tokens section), ipal-upgrade 1.15.0 note, ipal-audit SKILL + audit.sh token checks - theme.md, consent.md, accessibility.md (a11y.css), lightbox.md, PROGRAMISTA §2.5 - /tokens entry lists its exports explicitly; docs coverage test includes it Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ca8e93eaf4
commit
cf205c59ef
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user