theme: export color metadata and sync docs#226
Open
geoquant wants to merge 37 commits intocloudflare:mainfrom
Open
theme: export color metadata and sync docs#226geoquant wants to merge 37 commits intocloudflare:mainfrom
geoquant wants to merge 37 commits intocloudflare:mainfrom
Conversation
commit: |
Contributor
Docs PreviewCommit: |
Contributor
Collaborator
Author
|
Reviewed the branch again after fixing the docs copy mismatch. A few files in this PR are not core to the color/theme/metadata change, but I left them in intentionally for observability rather than hiding them:
Happy to remove / split any of those if reviewers want the PR to stay narrower. Also: I rebuilt the Figma plugin locally while checking the stale-runtime concern. |
This reverts commit db3ca1a.
# Conflicts: # packages/kumo/src/code/provider.tsx # packages/kumo/src/code/server.tsx # packages/kumo/src/components/combobox/combobox.tsx
# Conflicts: # packages/kumo/src/styles/theme-kumo.css
# Conflicts: # packages/kumo/src/code/provider.tsx # packages/kumo/src/components/combobox/combobox.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





















Summary
@cloudflare/kumoand switch registry/Figma consumers to use it instead of scraping semantic colors from CSSlight-dark()theme registration for semantic utility compatibility, while continuing to use explicit[data-mode]scoped variables to prevent flickerlight-dark(...)andvar(--color-...)/var(--text-color-...)usage inside component class strings so token usage stays lint-enforcedToast Token Decision
We found raw class-string color values in
packages/kumo/src/components/toast/toast.tsx:light-dark(var(--color-red-600), var(--color-red-400))light-dark(var(--color-amber-700), var(--color-amber-500))For this PR, we intentionally switched to the nearest existing semantic tokens instead of introducing new ones:
text-kumo-danger->red-500light /red-400darktext-kumo-warning->yellow-800light /yellow-400darkThis keeps component code on semantic tokens and lets lint enforce the rule. If design wants exact parity with the prior toast colors, the follow-up should add dedicated tokens in
packages/kumo/scripts/theme-generator/config.tsrather than reintroducing raw values in component classes.Verification
pnpm --filter @cloudflare/kumo codegen:themespnpm --filter @cloudflare/kumo typecheckpnpm --filter @cloudflare/kumo exec vitest run scripts/theme-generator/generate-css.test.ts scripts/component-registry/utils.test.ts tests/imports/package-json-validation.test.ts tests/lint/no-primitive-colors.test.tspnpm --filter @cloudflare/kumo lintpnpm --filter @cloudflare/kumo buildpnpm --filter @cloudflare/kumo-docs-astro typecheckpnpm --filter @cloudflare/kumo-docs-astro buildpnpm --filter @cloudflare/kumo-figma typecheckpnpm --filter @cloudflare/kumo-figma validate