From ffeae7895072656843f96b58a90f2fa3a88bcb5c Mon Sep 17 00:00:00 2001 From: Hayden Bruin Date: Wed, 25 Nov 2026 13:00:56 +1100 Subject: [PATCH 1/3] feat: themes, 16px reading text and the Segmented rail Themes. Engine Magenta (dark, still the default) and Engine Magenta Light, selected with data-theme on or any subtree. Components name roles instead of white/black literals; the grey ramp is relative to the page; new --color-scrim and shadow colour hooks; derived tints and aliases re-resolve under [data-theme] only, so an app that sets no theme is unchanged. scripts/check-themes.ts (bun run check:themes, now in CI) checks each theme for the full contract, dark/default parity and AA on every text pair. Sub text. grey-400/300/200 and muted-foreground brighter on dark, darker on light, each about 1.3x the old contrast against its page. Reading size. --text-body and --text-nav (16px) replace every 13-15px size on body copy, sub text, labels, field values, table cells, tooltips, menu items and navigation. Badge chips, button labels and mock-screen content keep their sizes; text-small (13px) is for those only. Segmented. A pill rail for filters and dropdown triggers, matching the pill tabs. Every import inside src/lib is now relative instead of $lib/, so the folder works wherever it is copied. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 10 +- .github/workflows/release.yml | 186 ------------------ .releaserc.json | 136 ------------- scripts/check-themes.ts | 115 +++++++++++ src/app.css | 10 +- src/app.html | 8 +- src/lib/components/brand/engine-icon.svelte | 2 +- .../components/brand/engine-wordmark.svelte | 2 +- .../components/marketing/bento-card.svelte | 4 +- .../components/marketing/bento-grid.svelte | 2 +- src/lib/components/marketing/hero.svelte | 4 +- src/lib/components/marketing/marquee.svelte | 2 +- .../components/marketing/section-head.svelte | 4 +- .../components/marketing/site-banner.svelte | 6 +- .../components/marketing/site-footer.svelte | 12 +- .../components/marketing/site-header.svelte | 10 +- src/lib/components/marketing/stat-band.svelte | 10 +- src/lib/components/marketing/tour.svelte | 30 +-- .../ui/alert/alert-description.svelte | 8 +- .../components/ui/alert/alert-title.svelte | 8 +- src/lib/components/ui/alert/alert.svelte | 6 +- src/lib/components/ui/badge/badge.svelte | 6 +- src/lib/components/ui/button/button.svelte | 17 +- .../components/ui/card/card-content.svelte | 4 +- .../ui/card/card-description.svelte | 6 +- src/lib/components/ui/card/card-footer.svelte | 4 +- src/lib/components/ui/card/card-header.svelte | 4 +- src/lib/components/ui/card/card-title.svelte | 4 +- src/lib/components/ui/card/card.svelte | 4 +- .../components/ui/checkbox/checkbox.svelte | 2 +- .../ui/dialog/dialog-content.svelte | 2 +- .../ui/dialog/dialog-description.svelte | 4 +- .../components/ui/dialog/dialog-footer.svelte | 4 +- .../components/ui/dialog/dialog-header.svelte | 4 +- .../ui/dialog/dialog-overlay.svelte | 4 +- .../components/ui/dialog/dialog-title.svelte | 2 +- src/lib/components/ui/input/input.svelte | 8 +- src/lib/components/ui/label/label.svelte | 4 +- .../ui/popover/popover-content.svelte | 2 +- .../components/ui/progress/progress.svelte | 2 +- .../ui/radio-group/radio-group-item.svelte | 2 +- .../ui/radio-group/radio-group.svelte | 2 +- .../responsive-dialog-content.svelte | 4 +- .../responsive-dialog-description.svelte | 4 +- .../responsive-dialog-footer.svelte | 4 +- .../responsive-dialog-header.svelte | 4 +- .../responsive-dialog-title.svelte | 2 +- src/lib/components/ui/segmented/index.ts | 40 ++++ .../components/ui/segmented/segmented.svelte | 26 +++ .../ui/select/select-content.svelte | 2 +- .../ui/select/select-group-heading.svelte | 4 +- .../components/ui/select/select-item.svelte | 4 +- .../select/select-scroll-down-button.svelte | 2 +- .../ui/select/select-scroll-up-button.svelte | 2 +- .../ui/select/select-separator.svelte | 4 +- .../ui/select/select-trigger.svelte | 4 +- .../components/ui/separator/separator.svelte | 2 +- .../components/ui/skeleton/skeleton.svelte | 2 +- src/lib/components/ui/switch/switch.svelte | 4 +- src/lib/components/ui/table/table-body.svelte | 4 +- .../components/ui/table/table-caption.svelte | 8 +- src/lib/components/ui/table/table-cell.svelte | 6 +- .../components/ui/table/table-footer.svelte | 4 +- src/lib/components/ui/table/table-head.svelte | 8 +- .../components/ui/table/table-header.svelte | 4 +- src/lib/components/ui/table/table-row.svelte | 6 +- src/lib/components/ui/table/table.svelte | 6 +- .../components/ui/tabs/tabs-content.svelte | 2 +- src/lib/components/ui/tabs/tabs-list.svelte | 2 +- .../components/ui/tabs/tabs-trigger.svelte | 6 +- .../components/ui/textarea/textarea.svelte | 4 +- .../ui/tooltip/tooltip-content.svelte | 4 +- src/lib/index.ts | 26 ++- src/lib/styles/index.css | 29 ++- src/lib/styles/themes/README.md | 124 ++++++++++++ .../styles/themes/engine-magenta-light.css | 98 +++++++++ src/lib/styles/themes/engine-magenta.css | 73 +++++++ src/lib/styles/themes/index.css | 11 ++ src/lib/styles/tokens.css | 88 +++++++-- src/lib/styles/utilities.css | 1 + src/lib/themes.ts | 9 + src/lib/utils.ts | 2 +- src/routes/+layout.svelte | 2 + src/routes/+page.svelte | 7 +- src/routes/Agents.svelte | 36 ++-- src/routes/Brand.svelte | 174 ++++++++-------- src/routes/Components.svelte | 42 ++-- src/routes/DoNot.svelte | 6 +- src/routes/MarketingKit.svelte | 103 +++++----- src/routes/Row.svelte | 2 +- src/routes/Section.svelte | 4 +- src/routes/ThemeSwitcher.svelte | 31 +++ 92 files changed, 996 insertions(+), 716 deletions(-) delete mode 100644 .github/workflows/release.yml delete mode 100644 .releaserc.json create mode 100644 scripts/check-themes.ts create mode 100644 src/lib/components/ui/segmented/index.ts create mode 100644 src/lib/components/ui/segmented/segmented.svelte create mode 100644 src/lib/styles/themes/README.md create mode 100644 src/lib/styles/themes/engine-magenta-light.css create mode 100644 src/lib/styles/themes/engine-magenta.css create mode 100644 src/lib/styles/themes/index.css create mode 100644 src/lib/themes.ts create mode 100644 src/routes/ThemeSwitcher.svelte diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00c5db9..126bd57 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,10 +27,12 @@ jobs: - name: Types and Svelte check run: bun run check - # `svelte-package` + publint. publint is the guard that matters: it - # validates the exports map against what consumers actually resolve, so - # a broken subpath or a missing `svelte` condition fails here rather - # than in engine or rgs after a release. + - name: Themes complete and readable + run: bun run check:themes + + # `svelte-package` + publint. Nothing installs the package any more + # (products copy src/lib), but packaging is still the quickest proof + # that src/lib compiles on its own, with no help from the gallery. - name: Build package run: bun run build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index e9016d3..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,186 +0,0 @@ -name: release - -# Every push to main releases, if the commits since the last tag warrant one. -# No release PR, no approval step: semantic-release reads the conventional -# commits, works out the next version, tags it, writes the GitHub release notes -# and publishes to npm in a single run. -# -# A push with nothing releasable in it (docs:, chore:, ci:) is a no-op. That is -# the behaviour to expect rather than a failure — see .releaserc.json for which -# commit types earn which bump. -# -# PUBLISHES TO npmjs, PUBLICLY, WITH NO TOKEN. Authentication is npm trusted -# publishing: GitHub Actions mints a short-lived OIDC token, npm verifies it -# against the Trusted Publisher configured on the package, and no long-lived -# secret exists to leak or expire. `id-token: write` below is what makes that -# possible, and @semantic-release/npm@13 detects the OIDC context and skips its -# token check. -# -# Every release goes to BOTH registries: npmjs first (canonical), then mirrored -# to GitHub Packages. npm is what the consumer repos install from, because -# GitHub Packages requires an access token to install even for public packages — -# per GitHub's own docs — which would put a PAT back in every developer's -# ~/.npmrc and every CI job. The mirror exists for the org-internal listing, not -# for consumption. -# -# npm provenance is generated automatically under trusted publishing, so the -# published package carries a verifiable link back to this repo and this -# workflow run. It requires a public repo and a public package; both hold. -# -# ONE-TIME SETUP ON npmjs, which cannot be done from here: -# npmjs.com -> @engineio/ui -> Settings -> Trusted Publisher -# Organization or user: engineio -# Repository: ui -# Workflow filename: release.yml -# Until that exists the publish step fails with an auth error, which is correct -# — it means nothing can publish under this name without going through here. -# -# WHAT THIS DELIBERATELY DOES NOT DO: write anything back to main. The usual -# semantic-release setup adds @semantic-release/changelog and -# @semantic-release/git so the version bump and CHANGELOG land as a commit on -# the release branch. Both are omitted, because main requires pull requests and -# a bot pushing straight to it would need a bypass nobody should hand a CI job. -# So package.json's version stays the placeholder 0.0.0-development — tags are -# the source of truth, and the real version is written in the runner just -# before publishing — and the GitHub release notes are the changelog. - -on: - push: - branches: [main] - workflow_dispatch: - -concurrency: - group: release - cancel-in-progress: false - -permissions: - contents: write # create tags and releases - id-token: write # mint the OIDC token for npm trusted publishing - packages: write # mirror the release to GitHub Packages - issues: write # semantic-release/github verifies these even with - pull-requests: write # comments switched off - -jobs: - release: - runs-on: ubuntu-latest - steps: - # fetch-depth: 0 is required, not tidiness — semantic-release works out - # the next version by reading every commit since the last tag, and a - # shallow clone has neither the tags nor the history to do it. - - uses: actions/checkout@v7 - with: - fetch-depth: 0 - - - uses: oven-sh/setup-bun@v2 - with: - bun-version: 1.3.14 - - # Node 22.14+ is the floor for trusted publishing. registry-url points - # npm at npmjs and writes the .npmrc it reads; there is no token to put - # in it. - - uses: actions/setup-node@v6 - with: - node-version: "22.14" - registry-url: https://registry.npmjs.org - - # Node 22 bundles npm 10.x, and trusted publishing needs npm >= 11.5.1. - # Without this the publish fails asking for credentials, which looks like - # a misconfigured Trusted Publisher rather than an old CLI. - - name: Ensure npm supports trusted publishing - run: | - npm install -g npm@^11 - npm --version - - - run: bun install --frozen-lockfile - - # Gate the release on the same checks CI runs. A broken build must not - # become a published version — once a version exists on the registry it - # cannot be replaced, only superseded. - - name: Verify before releasing - run: | - bun run check - bun run build - - - name: Release - run: bunx semantic-release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # Bootstrap escape hatch, and normally empty. - # - # npm's docs do not say whether a Trusted Publisher can be registered - # for a package name that does not exist yet, and a Trusted Publisher - # is configured in a package's settings — which a package needs to - # exist to have. If pre-registering turns out to be impossible, add an - # npm automation token as the NPM_TOKEN secret, let the first publish - # use it, then configure the Trusted Publisher and DELETE the secret. - # - # Passing it unconditionally is safe either way: an unset secret - # arrives as an empty string, @semantic-release/npm only writes an - # authToken when the value is truthy, and with nothing written it - # falls through to the OIDC path. So this line needs no edit when the - # secret is added or removed. - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - # BOTH names are required, and leaving this one out is why five - # release attempts failed with `401 GET /-/whoami`. - # - # `setup-node` with `registry-url` writes its own user-level .npmrc - # containing `//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}` - # and points NPM_CONFIG_USERCONFIG at it. With NODE_AUTH_TOKEN unset, - # npm expands it to an empty string and every registry call is - # unauthenticated — the same shadowing bug that an empty - # ${NODE_AUTH_TOKEN} in a project .npmrc causes locally, except - # inflicted by the action rather than by a checked-in file. - # - # NPM_TOKEN is what @semantic-release/npm reads; NODE_AUTH_TOKEN is - # what setup-node's .npmrc dereferences. Both point at the same - # secret. Under trusted publishing this whole block becomes - # unnecessary and can go. - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - # npm is the CANONICAL registry — it is what both consumer repos install - # from, and the only one that needs no credential. This mirrors the same - # version to GitHub Packages for the org-internal package listing and for - # anything still pointed there. If the two ever disagree, npm is right. - # - # Runs only when semantic-release actually released: its npm plugin writes - # the real version into package.json in the workspace during prepare, so a - # version other than the placeholder is the signal. A push with nothing - # releasable leaves the placeholder and this no-ops. - # - # --registry overrides publishConfig.registry on the command line, which - # is why package.json stays pinned to npmjs. GITHUB_TOKEN suffices — - # GitHub Packages accepts it for a same-repo publish, so there is no extra - # secret. Note this does NOT make GitHub Packages installable without a - # token: that is a GitHub restriction on reads, not on publishing. - - name: Mirror to GitHub Packages - run: | - set -euo pipefail - version=$(node -p "require('./package.json').version") - if [ "$version" = "0.0.0-development" ]; then - echo "no release this run — nothing to mirror" - exit 0 - fi - - # A DEDICATED npmrc, because setup-node's one only carries auth for - # registry.npmjs.org. Publishing with --registry=npm.pkg.github.com - # against it fails ENEEDAUTH: npm finds no credential for that host - # and does not fall back. NPM_CONFIG_USERCONFIG also means the - # runner's ~/.npmrc is ignored, so appending there does nothing. - rc=$(mktemp) - printf '//npm.pkg.github.com/:_authToken=%s\n' "$NODE_AUTH_TOKEN" > "$rc" - - echo "mirroring @engineio/ui@$version to GitHub Packages" - # A version already present on the mirror is success, not failure — - # it means a previous run got this far. Anything else is a real error. - if NPM_CONFIG_USERCONFIG="$rc" npm publish \ - --registry=https://npm.pkg.github.com \ - --ignore-scripts --tag latest 2>&1 | tee /tmp/mirror.log; then - echo "mirrored" - elif grep -qE 'EPUBLISHCONFLICT|cannot publish over|already exists' /tmp/mirror.log; then - echo "$version already on GitHub Packages — nothing to do" - else - echo "::error::mirror to GitHub Packages failed" - exit 1 - fi - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.releaserc.json b/.releaserc.json deleted file mode 100644 index 34fffbe..0000000 --- a/.releaserc.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "branches": [ - "main" - ], - "tagFormat": "v${version}", - "plugins": [ - [ - "@semantic-release/commit-analyzer", - { - "preset": "conventionalcommits", - "releaseRules": [ - { - "breaking": true, - "release": "minor" - }, - { - "type": "feat", - "release": "minor" - }, - { - "type": "fix", - "release": "patch" - }, - { - "type": "perf", - "release": "patch" - }, - { - "type": "tokens", - "release": "minor" - }, - { - "type": "style", - "release": "patch" - }, - { - "type": "refactor", - "release": "patch" - }, - { - "type": "docs", - "release": false - }, - { - "type": "test", - "release": false - }, - { - "type": "build", - "release": false - }, - { - "type": "ci", - "release": false - }, - { - "type": "chore", - "release": false - } - ], - "parserOpts": { - "issuePrefixes": [ - "GH-" - ] - } - } - ], - [ - "@semantic-release/release-notes-generator", - { - "preset": "conventionalcommits", - "presetConfig": { - "types": [ - { - "type": "feat", - "section": "Features" - }, - { - "type": "fix", - "section": "Bug Fixes" - }, - { - "type": "tokens", - "section": "Tokens" - }, - { - "type": "style", - "section": "Styling" - }, - { - "type": "perf", - "section": "Performance" - }, - { - "type": "refactor", - "section": "Refactors" - }, - { - "type": "docs", - "section": "Documentation" - }, - { - "type": "build", - "section": "Build", - "hidden": true - }, - { - "type": "ci", - "section": "CI", - "hidden": true - }, - { - "type": "chore", - "hidden": true - } - ] - }, - "parserOpts": { - "issuePrefixes": [ - "GH-" - ] - } - } - ], - "@semantic-release/npm", - [ - "@semantic-release/github", - { - "successComment": false, - "failComment": false, - "failTitle": false, - "releasedLabels": false - } - ] - ] -} diff --git a/scripts/check-themes.ts b/scripts/check-themes.ts new file mode 100644 index 0000000..6a4f47b --- /dev/null +++ b/scripts/check-themes.ts @@ -0,0 +1,115 @@ +import { readFileSync, readdirSync } from "node:fs" +import { join } from "node:path" + +const styles = join(import.meta.dir, "../src/lib/styles") +const themesDir = join(styles, "themes") + +const declarations = (css: string) => + new Map([...css.matchAll(/(--[a-z0-9-]+|color-scheme)\s*:\s*([^;]+);/g)].map((m) => [m[1], m[2].trim()])) + +const tokens = readFileSync(join(styles, "tokens.css"), "utf8") +const defaults = declarations(tokens.slice(tokens.indexOf("@theme {"), tokens.indexOf("\n}\n", tokens.indexOf("@theme {")))) + +const themes = readdirSync(themesDir) + .filter((f) => f.endsWith(".css") && f !== "index.css") + .map((file) => { + const css = readFileSync(join(themesDir, file), "utf8") + const selector = css.match(/\[data-theme~="([^"]+)"\]/)?.[1] + return { file, selector, values: declarations(css.replace(/\/\*[\s\S]*?\*\//g, "")) } + }) + +const canonical = themes.find((t) => t.selector === "engine-magenta") +if (!canonical) throw new Error("themes/engine-magenta.css is missing; it defines the contract") +const contract = [...canonical.values.keys()] + +const hex = (v: string | undefined) => { + const m = v?.match(/^#([0-9a-f]{6})$/i) + if (!m) return undefined + const n = parseInt(m[1], 16) + return [(n >> 16) & 255, (n >> 8) & 255, n & 255] +} +const luminance = (rgb: number[]) => { + const [r, g, b] = rgb.map((c) => { + const s = c / 255 + return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4 + }) + return 0.2126 * r + 0.7152 * g + 0.0722 * b +} +const ratio = (a: number[], b: number[]) => { + const [x, y] = [luminance(a), luminance(b)].sort((p, q) => q - p) + return (x + 0.05) / (y + 0.05) +} +const tint = (colour: number[], page: number[], amount: number) => + colour.map((c, i) => Math.round(c * amount + page[i] * (1 - amount))) + +const pairs: [string, string, number, string][] = [ + ["foreground", "background", 7, "body text"], + ["card-foreground", "card", 7, "text on a card"], + ["popover-foreground", "popover", 7, "text in a popover"], + ["muted-foreground", "background", 4.5, "secondary text"], + ["muted-foreground", "card", 4.5, "secondary text on a card"], + ["grey-300", "background", 4.5, "grey-300 text"], + ["grey-300", "card", 4.5, "grey-300 text on a card"], + ["grey-400", "grey-850", 4.5, "placeholder in a field"], + ["primary", "background", 3, "magenta text (15px bold and up)"], + ["primary-foreground", "primary", 3, "label on a magenta fill (15px bold and up)"], + ["primary-300", "primary-tint-12", 4.5, "ink on a magenta tint"], + ...(["success", "warning", "danger"] as const).flatMap((s): [string, string, number, string][] => [ + [s, "background", 4.5, `${s} text`], + [s, `${s}-tint-12`, 4.5, `${s} text on its tint`], + [`${s}-foreground`, s, 4.5, `ink on a ${s} fill`], + ]), +] + +let failed = false +const fail = (msg: string) => { + failed = true + console.log(` FAIL ${msg}`) +} + +for (const theme of themes) { + console.log(`\n${theme.file} [data-theme~="${theme.selector}"]`) + if (!theme.selector) fail("no [data-theme~=\"…\"] selector") + const full = theme.values.has("color-scheme") + if (!full) console.log(" overlay theme (no color-scheme): only its own tokens are checked") + + for (const name of theme.values.keys()) + if (!contract.includes(name) && !name.startsWith("--color-") && !name.startsWith("--shadow-")) + fail(`${name} is not a theme token`) + + if (full) for (const name of contract) if (!theme.values.has(name)) fail(`missing ${name}`) + + if (theme === canonical) + for (const [name, value] of theme.values) + if (defaults.has(name) && defaults.get(name) !== value) + fail(`${name} is ${value} here but ${defaults.get(name)} in tokens.css`) + + if (!full) continue + const get = (name: string) => { + const page = hex(theme.values.get("--color-background"))! + const m = name.match(/^(.*)-tint-12$/) + if (m) { + const base = hex(theme.values.get(`--color-${m[1]}`)) + return base && tint(base, page, 0.12) + } + return hex(theme.values.get(`--color-${name}`)) + } + for (const [fg, bg, min, label] of pairs) { + const a = get(fg) + const b = get(bg) + if (!a || !b) { + console.log(` skip ${label}: ${fg} on ${bg} is not a plain hex`) + continue + } + const r = ratio(a, b) + const line = `${r.toFixed(2).padStart(5)}:1 ${label} (${fg} on ${bg}, needs ${min})` + if (r < min) fail(line) + else console.log(` ok ${line}`) + } +} + +if (failed) { + console.log("\nthemes: failed") + process.exit(1) +} +console.log("\nthemes: clean") diff --git a/src/app.css b/src/app.css index 1d5c425..90eecff 100644 --- a/src/app.css +++ b/src/app.css @@ -1,13 +1,9 @@ /* - The gallery's stylesheet. A consumer's version of this file is three lines: + The gallery's stylesheet, and the same two lines a product's app.css has + after copying this repo's src/lib into its tree: @import "tailwindcss"; - @import "@engineio/ui/styles"; - @source "../node_modules/@engineio/ui/dist"; - - Here the package is the local `src/lib`, which Tailwind already scans, so no - `@source` is needed — that line exists purely to reach across a package - boundary into node_modules. + @import "./lib/engine-ui/styles/index.css"; */ @import "tailwindcss"; diff --git a/src/app.html b/src/app.html index 9f12e4c..eb9e486 100644 --- a/src/app.html +++ b/src/app.html @@ -3,7 +3,13 @@ - + + Engine design system diff --git a/src/lib/components/brand/engine-icon.svelte b/src/lib/components/brand/engine-icon.svelte index 193ef4b..fe1944b 100644 --- a/src/lib/components/brand/engine-icon.svelte +++ b/src/lib/components/brand/engine-icon.svelte @@ -13,7 +13,7 @@
-

{title}

+

{title}

{#if lead}

{lead}

{/if} diff --git a/src/lib/components/marketing/site-banner.svelte b/src/lib/components/marketing/site-banner.svelte index d4a793f..88bcde3 100644 --- a/src/lib/components/marketing/site-banner.svelte +++ b/src/lib/components/marketing/site-banner.svelte @@ -1,5 +1,5 @@ -
+ -
+
© {new Date().getFullYear()} {name}. {#if legal.length > 0} {#each legal as entry (entry.name)} - {entry.name} + {entry.name} {/each} {/if} diff --git a/src/lib/components/marketing/site-header.svelte b/src/lib/components/marketing/site-header.svelte index 9ad486a..3ffe255 100644 --- a/src/lib/components/marketing/site-header.svelte +++ b/src/lib/components/marketing/site-header.svelte @@ -3,7 +3,7 @@
@@ -99,14 +99,14 @@ href={action.href} target={action.external ? "_blank" : undefined} rel={action.external ? "noopener" : undefined} - class="ml-auto flex items-center gap-1 self-center rounded-control border border-grey-500 px-3.5 py-1.5 text-small font-semibold whitespace-nowrap text-white md:hidden" + class="ml-auto flex items-center gap-1 self-center rounded-control border border-grey-500 px-3.5 py-1.5 text-nav font-semibold whitespace-nowrap text-foreground md:hidden" > {action.name}
-

+

Magenta is the accent on both. One accent per surface, never two.

-

+

Write sub-brands in full on first use. Engine Studio, Engine Integration. Never abbreviate to ES or EI. Once a lockup has established which product is speaking, later references on the same @@ -277,12 +278,12 @@

-

- Colour is a two-value variant - and not currentColor. With +

+ Colour is a two-value variant + and not currentColor. With currentColor, any ancestor's text colour silently becomes brand colour, and a magenta wordmark is one careless - text-primary away. Size by + text-primary away. Size by height alone. The brand forbids distortion, and neither the turbo's 1001:1000 — square to the eye, not to the box — nor the wordmark's 2001:732.5 is a ratio anybody reproduces by hand. @@ -291,18 +292,18 @@

{#each swatches as s (s.token)} -
+
-

{s.name}

-

{s.hex}

-

--color-{s.token}

+

{s.name}

+

{s.hex}

+

--color-{s.token}

{/each} @@ -320,14 +321,14 @@ class="h-16 rounded-field border border-grey-700" style="background-color: var(--color-grey-{g})" >
-

grey-{g}

+

grey-{g}

{/each} {#each statusSwatches as s (s.token)} -
+
-

{s.name}

-

{s.hex}

-

--color-{s.token}

+

{s.name}

+

{s.hex}

+

--color-{s.token}

{/each} -

+

Status is functional colour. It reports state and nothing else. It is never decoration, never a second accent, and never a stand-in for - magenta. Ink on a status fill is always Off Black, because white fails - AA on all three. There is no - info colour. Use the neutral + magenta. Ink on a status fill is its foreground token: Off Black on + Engine Magenta, where white fails AA on all three, and white on the + light theme's deeper steps. There is no + info colour. Use the neutral ramp for informational states.

@@ -360,7 +362,7 @@ {#each type as t (t.role)}

{t.role}

@@ -369,17 +371,17 @@ {/each}

Mono

-

+

GAME_ID 7f3a91c2 · RTP 96.42% · 2300 live games

Condensed roles

@@ -388,24 +390,24 @@

-

+

DM Sans has no condensed cut. - --font-condensed and - --font-extra-condensed remain + --font-condensed and + --font-extra-condensed remain as roles and resolve to the brand face, so big numbers and poster-scale words are set in DM Sans Black until the brand team assigns a condensed face. Display type is large: 92 to 104px on a 1480px page. Scaling Display 1 down to 48px does not produce a smaller display size. It produces an H1.

-

+

DM Sans is a variable Google Font under the Open Font Licence: weight 100 to 1000, and an optical-size axis from 9 to 40, so body sizes get the looser cut and display sizes the tight one. There is no substitute face. A machine that cannot reach Google renders a size-adjusted Helvetica Neue or Arial matched to DM Sans's width, which the package ships as - "DM Sans Fallback". - --font-mono resolves to the + "DM Sans Fallback". + --font-mono resolves to the brand face; JetBrains Mono is retired, and a product that needs character-cell alignment binds its own monospace.

@@ -419,8 +421,8 @@ {#each radii as r (r.name)}
-

{r.name}

-

{r.value}

+

{r.name}

+

{r.value}

{/each} @@ -428,13 +430,13 @@
-

Hairline

-

1px · structure

+

Hairline

+

1px · structure

-

Container rule

-

1.5px · cards and panels

+

Container rule

+

1.5px · cards and panels

@@ -442,10 +444,10 @@
26 → 18 → 10 @@ -454,11 +456,11 @@
-

+

Depth comes from rules and nested panels, not shadow. The package holds two shadow tokens, - --shadow-panel and - --shadow-modal, and both are + --shadow-panel and + --shadow-modal, and both are for product chrome and modals. Neither belongs on a brand surface. Neither is a substitute for the rule that should have been there.

@@ -472,11 +474,11 @@

Page

-

+

1480px maximum, 40px gutters, 72px on large brand pages, for product surfaces. This page is not one: it sits on the 1180px marketing column described under Marketing. @@ -484,32 +486,32 @@

Reading

-

+

920px, and this paragraph stops there. Body copy that runs the full 1480px is unreadable however correct the type scale is.

Brand page

-

+

1480 × 836. Slides and statement pages are drawn at that ratio.

Card

-

+

20px padding, 28px on the large variant.

@@ -520,7 +522,7 @@
{#each rhythm as sp (sp)}
-

+

{sp}px

@@ -533,7 +535,7 @@ {#each groupSpace as sp (sp)}
-

{sp}

+

{sp}

{/each} @@ -551,7 +553,7 @@
-

+

The hairline sits 14px from the top, inset 24px each side, and the type is set flush to the bottom-left instead of centred. That is the deck's signature composition. Centring it is the most common way a page stops @@ -569,12 +571,12 @@ {#each durations as d (d.ms)}

{d.name}

-

{d.ms}

-

{d.use}

+

{d.ms}

+

{d.use}

{/each}
@@ -590,7 +592,7 @@ > Run - + Same distance, same 640ms, three curves. @@ -599,8 +601,8 @@ {#each easings as e (e.token)}
-

{e.token}

-

{e.curve}

+

{e.token}

+

{e.curve}

-

{e.use}

+

{e.use}

{/each}
@@ -625,12 +627,12 @@
-

+

Motion is fast, but it is never mandatory. - prefers-reduced-motion drops + prefers-reduced-motion drops everything to fades, and the package's base layer already does that globally. A product importing - @engineio/ui/styles gets it + styles/index.css gets it without writing a line. Turn the setting on and press Run again. The blocks jump, and nothing on this page breaks.

@@ -647,7 +649,7 @@ >

Rigs · Keycaps · Tooling

@@ -672,7 +674,7 @@ >

Pipework · Manifolds · Junctions

@@ -693,7 +695,7 @@
-

+

Never people. Never warm tones. Never stock-office imagery. No handshakes, no laptops, no meeting rooms. Always cropped into a rounded rectangle at the media radius or bled to the page edge, with the @@ -703,7 +705,7 @@ Integration the connective, both monochrome.

-

+

The two frames hold no photography. None ships in this package, and filling them with a stand-in would put an image into the design system that the brand never approved. The scrim under the type is the only @@ -723,7 +725,7 @@ {#each sentences as v (v.shape)}

{v.shape}

@@ -737,36 +739,36 @@

Written

Not written

Why

{#each voicePairs as v (v.written)}
-

+

{v.written}

-

+

{v.avoid}

-

{v.why}

+

{v.why}

{/each}
-

+

No emoji. Anywhere. Not in brand material, not in product UI, not in copy, and not in a commit message that ends up in release notes. The only non-alphanumeric glyphs the brand sanctions are the multiplication diff --git a/src/routes/Components.svelte b/src/routes/Components.svelte index 1893c71..060c906 100644 --- a/src/routes/Components.svelte +++ b/src/routes/Components.svelte @@ -112,13 +112,13 @@ blocked

-

+

There is no solid variant. An opaque fill can only be right on one surface, and these chips have to read on the page, on a card and in a table cell. The status variants are functional, not categorical. Reach - for success when something + for success when something has succeeded, never because green suited the row. The brand chip's ink - is primary-300 and not pure + is primary-300 and not pure magenta, because magenta on its own tint is 4.37:1 and the brand forbids magenta text below 15px bold.

@@ -150,12 +150,12 @@
-

- The bar is aria-hidden, so +

+ The bar is aria-hidden, so the title has to carry the message with the colour ignored entirely. "Upload failed." beats "Error." The neutral variant takes a grey bar instead of none, so a mixed stack keeps its left edge. Pass - onDismiss to get the close + onDismiss to get the close control, and omit it for a static alert.

@@ -194,7 +194,7 @@ > - + {switchOn ? "Enabled" : "Disabled"} @@ -227,7 +227,7 @@
- 64% + 64%
@@ -246,9 +246,9 @@
- + Inner panel · 10px
@@ -271,13 +271,13 @@ Bets Issues - + Pill tabs, for switching a panel's contents. - + Bets. - + Issues. @@ -288,13 +288,13 @@ Catalogue Settings - + Underline tabs, for navigating a page's sections. - + Catalogue. - + Settings. @@ -335,7 +335,7 @@ {/snippet} -

+

Popovers sit on the raised surface at 10px radius, with the panel shadow reserved for product chrome.

@@ -430,7 +430,7 @@
@@ -466,9 +466,9 @@
-

+

Hover a row for the 6% white wash. The second row is - data-state="selected", which + data-state="selected", which takes the magenta tint. Never a coloured border or an edge accent, both of which the brand rules out. Because the cells carry no fill there are no fill collisions. A Badge, a Separator or an unchecked Switch reads @@ -487,5 +487,5 @@

-

Below the rule.

+

Below the rule.

diff --git a/src/routes/DoNot.svelte b/src/routes/DoNot.svelte index c5df8bd..8b01e61 100644 --- a/src/routes/DoNot.svelte +++ b/src/routes/DoNot.svelte @@ -16,7 +16,7 @@ { rule: "No all-caps headlines. No italics. No other typefaces.", ci: false }, { rule: "No emoji, illustration, textures, patterns or noise.", ci: true }, { rule: "No photography of people, no warm tones, no stock office scenes.", ci: false }, - { rule: "No light-mode variant.", ci: false }, + { rule: "No `dark:` variants. A component names a role; the theme decides its value.", ci: false }, { rule: "No casino iconography. No coins, chips, jackpots, gold or celebration.", ci: false }, { rule: "No scaling display type down to 48px and calling it display.", ci: false }, ] @@ -29,14 +29,14 @@
{#each prohibitions as pr (pr.rule)}
-

{pr.rule}

+

{pr.rule}

{#if pr.ci} ci {/if}
{/each}
-

+

When something is not covered here, choose the option that is quieter and more mechanical. That resolves most of what this list does not.

diff --git a/src/routes/MarketingKit.svelte b/src/routes/MarketingKit.svelte index f276022..f1a4c63 100644 --- a/src/routes/MarketingKit.svelte +++ b/src/routes/MarketingKit.svelte @@ -42,7 +42,8 @@ { cls: "text-lead", spec: "clamp(17px, 1.4vw, 20px) · 1.5", sample: "You just need to pay the invoice, and we will settle with the creators.", cap: "max-w-[52ch]" }, { cls: "text-card-title", spec: "17px · 1.35 · 600", sample: "Near real-time analytics, see exactly how the integration is performing.", cap: "max-w-[40ch]" }, { cls: "text-stat", spec: "42px · 0.94 · 900 · tabular", sample: "9.7B", cap: "" }, - { cls: "text-small", spec: "13px · 1.5", sample: "Platform-wide totals, live from engine.io.", cap: "" }, + { cls: "text-body", spec: "16px · 1.5 · every caption, label and line of sub text", sample: "Platform-wide totals, live from engine.io.", cap: "" }, + { cls: "text-nav", spec: "16px · 1.25 · every navigation item, or larger", sample: "How it works", cap: "" }, ] const motionTimings = [ @@ -144,46 +145,46 @@ {#snippet screen(s: TourStep)} {#if s.id === "apply"}
-

Apply for access.

+

Apply for access.

Tell us who you are. The Engine team reviews every application.

Your name - Jane Doe + Jane Doe
Company website - https://northwind.example + https://northwind.example
- Submit application - Received. Under review. + Submit application + Received. Under review.
{:else if s.id === "limits"}
-

Exposure limits.

+

Exposure limits.

Caps for every game you run. Save and they apply immediately.

Maximum exposure -

100,000.00 USD

+

100,000.00 USD

Maximum bet cost -

500.00 USD

+

500.00 USD

- Save exposure limits - Saved. + Save exposure limits + Saved.
{:else} @@ -192,7 +193,7 @@
Invoice -

INV-2026-09

+

INV-2026-09

Due in 20 days
@@ -200,17 +201,17 @@ {#each [["Turbine Rush", "905.13"], ["Keycap Clash", "658.85"], ["Pipework", "504.41"]] as [name, amount], j (name)}
  • {name} - {amount} + {amount}
  • {/each}
    Total due - 2,068.39 USD + 2,068.39 USD
    - Pay invoice - Paid. + Pay invoice + Paid.
    @@ -225,9 +226,9 @@
    {#each marketingColumn as t (t.token)}
    -

    {t.token}

    -

    {t.value}

    -

    {t.use}

    +

    {t.token}

    +

    {t.value}

    +

    {t.use}

    {/each}
    @@ -270,7 +271,7 @@ -

    +

    The header is `static` here only so the gallery can scroll past it. On a page it is sticky and the hero's art layer starts at its top edge, so the render shows through the glass at rest. The marquee takes real @@ -287,10 +288,10 @@ {#each marketingType as t (t.cls)}

    -

    {t.cls}

    -

    {t.spec}

    +

    {t.cls}

    +

    {t.spec}

    {#if t.cap} -

    {t.cap}

    +

    {t.cap}

    {/if}

    @@ -299,7 +300,7 @@

    {/each} -

    +

    No uppercase, no mono and no eyebrows on a landing. The page has four sizes of type; a tracked label is a fifth. Inside a mock screen the scale drops again — 15px bold titles, 11 to 13px text, 10px tags — @@ -315,9 +316,9 @@

    {#each motionTimings as t (t.name)}
    -

    {t.name}

    -

    {t.ms}

    -

    {t.use}

    +

    {t.name}

    +

    {t.ms}

    +

    {t.use}

    {/each}
    @@ -325,17 +326,17 @@ - Fields rise, the gauge sweeps, the tag swaps at three seconds. + Fields rise, the gauge sweeps, the tag swaps at three seconds. {#key grammarRuns}
    -

    Exposure limits.

    +

    Exposure limits.

    Unsaved - + Saved @@ -343,7 +344,7 @@
    Maximum exposure -

    +

    100,000.00 USD

    @@ -352,7 +353,7 @@
    Maximum bet cost -

    +

    500.00 USD

    @@ -361,11 +362,11 @@
    - + Save exposure limits - Saved. + Saved. Live @@ -375,11 +376,11 @@
    {/key} -

    +

    Rules learned the expensive way. Nothing plays until it is on screen. - Rotating rows never use rise + Rotating rows never use rise — the stagger leaves a hole — they use Svelte fly, flip and fade. A - reveal is opacity only, + reveal is opacity only, because a translate on it makes every anchor scroll land short. And when several things on a page rotate they share one beat and take turns, so only one thing is ever moving. @@ -391,7 +392,7 @@ note="The Stripe-style product walkthrough. A numbered step list beside a browser-frame mock, one screen per step, one callout hanging off the frame's corner, advancing on the progress bar's own animationend every eight seconds and paused while off screen. The shell is the component; the screens are yours, built from the motion grammar." > -

    +

    Clicking a step is the only control — no hover pause, no pause button, both tried and removed. The mock is decorative; the step list and the callout carry everything it shows. Under reduced motion the timer is @@ -415,15 +416,15 @@

    You keep -

    93%

    +

    93%

    Creators -

    5%

    +

    5%

    Engine -

    2%

    +

    2%