Repository navigation
[web-shared] Define design tokens once and follow the theme class for dark mode - #5524
Conversation
Co-authored-by: vercel-v[bot] <353008837+vercel-v[bot]@users.noreply.github.com>
🦋 Changeset detectedLatest commit: 97c4c08 The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Sim WorldSimulated world deterministic testing for races. Traces 🟢 world-sim scenario book — 0 fail of 45 total
Full trace: |
# Conflicts: # packages/web-shared/src/styles.css
…yles Co-authored-by: vercel-v[bot] <353008837+vercel-v[bot]@users.noreply.github.com>
…vious commit Co-authored-by: vercel-v[bot] <353008837+vercel-v[bot]@users.noreply.github.com>
|
No backport to This is a design-token refactor and feature enhancement for the observability UI. It adds new tokens, a To override, re-run the Backport to stable workflow manually via |
Defines the design tokens once, in
@workflow/web-shared/styles.css, with the full palette, shadows and theme tokens. It also removes the second palette in@workflow/web.Why
The tokens in
web-shared/src/styles.csshad errors and gaps:background-100andbackground-200were swapped.gray-alpha-600was 0.24 instead of 0.34.--ds-shadow-*tokens it referenced were undefined.surface-hover/surface-active,hocusand the copystrongweight.dark:followed the OS setting, but the app switches theme with a class.web/app/globals.cssalso had its own radius scale (6/8/10/14px instead of 4/6/8/12), extra shadows, Tailwind v3 hex node fills, and a second copy of the palette underprefers-color-scheme.Changes
styles.cssholds the full token set.darkmatches both.dark(next-themes in@workflow/web) and.dark-theme.--color-*: initialstays commented out so Tailwind's default colours still resolve.web/app/globals.cssremoves:prefers-color-schemeblock--ds-green-50--geist-background/--accents-*aliasesThe shadcn variables still in use are mapped onto the tokens on every theme root. Node fills use
--ds-{hue}-100.button.tsxuses the token radii (rounded-sm/md/lg), and its three repeated dark selectors becomedark:. Thehsl(0 0% 22%)/hsl(0 0% 80%)hover fills stay because no token sits one step offgray-1000.These files lose
dark:overrides for colours the tokens already flip: bothui/alert.tsxfiles,live-status.tsxand both flow-graph viewers.red-50/red-950and theorange-*text and border colours become red/amber token steps.context-card.tsx: the tip stroke usesgray-alpha-400instead of hardcoded hex, and the extra ring that--ds-shadow-tooltipalready includes is gone.minimap.tsx: drops itsrgb()fallback and its repeated dark selectors.The unused
tooltip-enterkeyframe is removed.live-status.tsx: the class was a broken template string ($without{}), so no colour applied. It now interpolates and keepstext-red-600.packages/web-shared/AGENTS.md: keep tokens instyles.cssonly, and don't redeclare them.--muted-foregroundmaps togray-900and--destructivetored-800. Replacingtext-muted-foregroundcall sites and adjusting status colours are left to follow-up PRs.Breaking changes
[data-theme="dark"], anddark-theme:/light-theme:no longer match.dark/.light. Usedark:instead.gh search codefound no uses in this repo or thevercelorg.styles.cssno longer defines:font-v0andgeist-sr-onlyutilities--geist-space-*and--geist-page-marginvariables--font-sans,--font-pixel-*and--font-serif*aliasesTesting
pnpm turbo typecheck test build --continue --filter=@workflow/web-shared --filter=@workflow/web: 12/12 taskspnpm biome check packages/web-shared packages/web: exit 0@workflow/webCSS:rounded-sm/md/lgare 4/6/8px.prefers-color-schemerules.dark:compiles to:where(.dark,.dark *,.dark-theme,.dark-theme *).--ds-background-100-valueis0,0%,4%.Not checked visually: light and dark mode, button hover, the context-card tip, the minimap and the flow graph.
Co-authored-by: vercel-v[bot] <353008837+vercel-v[bot]@users.noreply.github.com>