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
+19 -1
View File
@@ -14,6 +14,15 @@ Database names follow one rule, and seeding a live site touches only the records
fifteen ready page sections and ten page templates.
### New
- **Design-token standard** ([design-tokens.md](./design-tokens.md)): one set of `--ipal-*` names for every site,
only the values differ per brand. `@intecion/ipal-kit/tokens.css` (neutral defaults, light/dark on `data-theme`,
`[data-surface="inverse"]` scope, reduced motion), `@intecion/ipal-kit/tailwind.css` (Tailwind 4 preset: `bg-surface`,
`text-fg`, `text-on-primary`, `py-section`, `rounded-card`, `duration-fast`…), `@intecion/ipal-kit/a11y.css` (the
accessibility widget's CSS through the tokens). New entry `@intecion/ipal-kit/tokens` (`defineTokens`, `tokensToCss`,
`contrastReport`, `fluidClamp`, `IPAL_TOKENS`, `ipalVar`, `IPAL_BREAKPOINTS` …; the first four names also from the root).
New bin `ipal-tokens`: `src/design/tokens.ts` → `src/design/tokens.css` + WCAG contrast check (`--check` for CI).
Templates `DESIGN.md` and `tokens.ts` in `ipal-setup/resources`. `ipal-audit` checks the standard.
- `fluid.css` / `fluid-wide.css`: `--ipal-fs-xs`, `--ipal-fs-h4`, `--ipal-space-stack`, `--ipal-space-section-sm`.
- **Block library** ([block-library.md](./block-library.md)): `hero`, `textMedia`, `featureGrid`, `cta`, `richText`, `faq`,
`contact`, `gallery`, `testimonials`, `stats`, `steps`, `logos`, `team`, `pricing`, `entryList` — Payload block +
server component each, `{ en, pl }` panel, accessibility built in, styled only with design-token utilities.
@@ -34,6 +43,12 @@ fifteen ready page sections and ten page templates.
`skip (not listed)`. The seed templates (`ipal-site`, `ipal-form`) read it.
### Changed
- **Cookie banner / button colours** read the single token names (`--ipal-surface`, `--ipal-text` …) instead of
`dark:` + `--ipal-*-dark`. With `tokens.css` they switch with the theme. Without it, the built-in fallback follows the
page's `color-scheme` (`light-dark()`): a site without a dark theme no longer gets a dark banner on a dark-mode
device. A `-dark` variable a site still sets is used as the dark fallback. The secondary button's dark fallback text
is `#d4d4d4` (was `#e5e5e5`).
- Lightbox fade: `--ipal-lightbox-duration` defaults to `var(--ipal-duration, 200ms)`; new `--ipal-lightbox-easing`.
- **Admin labels:** the link "Open in new tab" checkbox is now **New tab** (with a description) and the table-of-contents
switch **Show contents** — shorter labels per admin-ux; the stored fields are unchanged.
- **A full seed of a live database is refused:** a run without `only` / `SEED_ONLY` against `NODE_ENV=production` or
@@ -48,7 +63,10 @@ fifteen ready page sections and ten page templates.
2. Optional: name the databases `<domain without dots>_prod` / `_dev` and add `ipalEnvRules({ databaseName: true })`
to see a warning when `DATABASE_URI` points elsewhere. Existing databases need not be renamed.
3. Seed scripts copied from older templates: take the new `SEED_ONLY` handling from `ipal-site` / `ipal-form`.
4. Block library — optional, nothing changes until you turn blocks on. New sites: the starter turns on eight blocks.
4. Optional: adopt the design-token standard (design-tokens.md → "Migrating an existing site"; **ipal-upgrade**). A
site that styles the cookie banner only through `--ipal-*-dark` for its dark theme and does not adopt `tokens.css`:
check the banner in the dark theme (the dark fallback now needs `color-scheme: dark`, which `<ThemeScript>` sets).
5. Block library — optional, nothing changes until you turn blocks on. New sites: the starter turns on eight blocks.
Existing sites move block by block when they get work (an own block with the same slug and fields can be replaced by
the library block with `slug`, else a migration with **ipal-migrate-fields**). After turning blocks on:
`pnpm generate:types`, `pnpm payload generate:importmap`, Postgres/SQLite `pnpm payload migrate:create`.