Skip to content
This repository was archived by the owner on Nov 25, 2026. It is now read-only.

feat!: themes, 16px reading text, and engine-ui as a reference - #10

Merged
HaydenBruin merged 3 commits into
mainfrom
feat/themes-and-reference
Nov 25, 2026
Merged

HaydenBruin merged 3 commits into
mainfrom
feat/themes-and-reference

Conversation

@HaydenBruin

Copy link
Copy Markdown
Contributor

Adds theming and a 16px floor for reading text, and turns engine-ui from an npm package into a reference that products copy from. Merging this publishes nothing to npm: the release workflow is removed in this PR, so the merge redeploys only the gallery and AGENTS.md.

1. Themes

  • Engine Magenta (dark) stays the default. Engine Magenta Light is new. You select a theme with data-theme on <html> or on any subtree.
  • Components name roles instead of white/black, so no dark: variants are needed.
  • The grey ramp is relative to the page. Each light step matches its dark twin's contrast against its own page.
  • New roles: --color-scrim, plus --shadow-panel-color and --shadow-modal-color.
  • Derived tints and aliases re-resolve under [data-theme] only. An app that sets no theme renders exactly as before, including the casino's @theme bridge.
  • bun run check:themes (now in CI) checks each theme for the full contract, for parity between the dark theme and the defaults, and for AA on 20 text pairs.
  • An overlay theme changes a few roles and stacks on a full theme (data-theme="engine-magenta volt").
  • The contract is in src/lib/styles/themes/README.md.

2. Brighter sub text

grey-400, grey-300 and grey-200 and muted-foreground are about 1.3× the old contrast: brighter on dark, darker on light. For example, grey-300 goes from #9a9a9a to #b0b0b0, 6.9:1 → 8.9:1. This changes the default dark look for every product that picks it up.

3. 16px reading text

  • --text-body and --text-nav (both 16px) replace every 13–15px size on body copy, sub text, labels, field values, table cells, tooltips, menu items and navigation.
  • Exempt: badge chips, button labels, and the content of mock screens. text-small (13px) is kept for those only.

4. Segmented

A pill rail for filters and dropdown triggers.

5. A reference, not a package

  • Products copy src/lib with scripts/copy-into.ts and own the copy, in one of two ways:
    • as a folder;
    • with --package, as a local workspace package still named @engineio/ui, so studio's 225 importing files and rgs's 48 change nothing.
  • ENGINE-UI.md in the copy records the upstream commit. The next change is git diff <sha> HEAD -- src/lib.
  • Every $lib/ import inside src/lib is now relative, so a copy resolves wherever it lands.
  • The release workflow, .releaserc.json and the semantic-release dependencies are removed, and the package is private.
  • README, AGENTS.md, the gallery and the agent skill describe the copy model. MIGRATION.md is the switch plan for studio, rgs and casino.

Verified

Check Result
bun run check 0 errors, 0 warnings
bun run check:themes both themes complete; every pair clears its AA floor
bun run build (svelte-package + publint) passes
bun run build:gallery passes
Palette lint (hex / stock palette) clean
Dark default unchanged except the intended changes computed-colour diff of 1,366 elements against main: only the gallery's inner-panel demos differ (#000 → page colour)
Light theme buttons, badges, cards, tabs, controls, dialog, sheet and marketing mocks screenshotted
No reading text under 16px scanned every visible text node in the gallery; only buttons, chips and mock screens remain under 16px
Copy, folder mode gallery built from a copy nested at src/lib/vendor/engine-ui: check and build pass, stylesheet byte-identical
Copy, --package mode scratch bun workspace with the copy as @engineio/ui (workspace:*), every import unchanged: check and build pass

Deliberately not done

  • No front is switched here. MIGRATION.md has the per-repo steps, including the extra Dockerfile COPY line both workspaces need.
  • No npm deprecation. 0.10.0 stays installable until nothing installs it.
  • Marketing landings stay dark. The hero render's mix-blend-screen needs a dark page, so landings should pin data-theme="engine-magenta".

Known

  • The fronts' own code uses text-white/bg-white in about 100 files, which breaks under the light theme. It also uses 14px text-xs and 13px text-small for sub text.
  • ENGINE-BRAND.md and ENGINE-DESIGN-SYSTEM.md in the engine repo still say there is no light theme, and the light values want brand-team sign-off.
  • The knowledge repo's engine-brand and front-conventions skills still describe consuming the package from node_modules.

🤖 Generated with Claude Code

HaydenBruin and others added 3 commits November 25, 2026 13:00
Themes. Engine Magenta (dark, still the default) and Engine Magenta Light,
selected with data-theme on <html> 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 <[email protected]>
Products copy src/lib into their own tree with scripts/copy-into.ts, either
as a folder or (--package) as a local workspace package still named
@engineio/ui so existing imports keep resolving, and own the copy.
ENGINE-UI.md in the copy records the upstream commit to diff from.

The release workflow, semantic-release config and dependencies are gone and
the package is private. @engineio/[email protected] stays on npm for the products
still installing it. README, AGENTS.md, the gallery and the agent skill
describe the copy model; MIGRATION.md is the plan for switching studio, rgs
and casino.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@HaydenBruin
HaydenBruin merged commit 3c6f1c6 into main Nov 25, 2026
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant