Skip to content

Ai week semantic with codemod - #6850

Draft
AliceMenzie wants to merge 27 commits into
mainfrom
AI-week-semanticWithCodemod
Draft

Ai week semantic with codemod#6850
AliceMenzie wants to merge 27 commits into
mainfrom
AI-week-semanticWithCodemod

Conversation

@AliceMenzie

Copy link
Copy Markdown
Contributor

Important: Request PR reviews on Slack

Please reach out to the design system team on Slack in #help_design_system for PR reviews. GitHub notifications (e.g. from tagging a person) are not actively monitored.

Why

What

Kitty-Al and others added 24 commits June 29, 2026 16:24
Bundle the semantic colour tokens into the generated variables.css so any
consumer of the design-tokens CSS gets them automatically, with no extra
import. The semantic block is appended by build:semantic (idempotent via a
marker comment) after build:json regenerates the primitives.

Also drop the Less output for the semantic tokens (CSS + SCSS only).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…xport

Spread the semantic colour tokens into `tokens.color`, keyed both by their
verbatim kebab name (`tokens.color['bg-brand-solid']`) and a camelCase alias
(`tokens.color.bgBrandSolid`). Preserve literal keys via `satisfies` so the
name unions stay type-safe, and add a `KebabToCamel` type + derived
`semanticColorTokensCamel` map.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Category-scope the generated semantic files so future token categories can sit
alongside them (e.g. semantic-typography): sass/semantic.scss -> sass/
semantic-color.scss and css/semantic.css -> css/semantic-color.css. Updates the
generator output paths and the build:semantic prettier target.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- JS guide: use semantic colour tokens instead of old primitives.
- SASS guide: use semantic tokens in examples; caution against manipulating
  colour opacity (accessibility + semantic tokens are solid); add an import-map
  table clarifying each category is a separate scoped entrypoint.
- example.scss: import sass/semantic-color and use a semantic token.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…emantic

Collapse the colour docs into one docs-only page that maps every semantic token
to the primitive it resolves to, with name + hex on both sides. Tokens with no
mapping yet are flagged. Converts the CSF story to a plain component rendered
inline in the MDX so there is a single sidebar entry instead of a story + docs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…erview

Document the tokens' many output forms (JS, CSS vars, SCSS, deprecated Less),
present Tailwind (@kaizen/tailwind preset) as the recommended way to consume
them, and note semantic tokens are not emitted as Less. Rename the docs README
page title from "README" to "Overview".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Revert @kaizen/design-tokens from a peer dependency to a regular runtime
dependency of @kaizen/tailwind, so Tailwind consumers get it transitively and
don't need to install it themselves. Update the changeset wording accordingly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…olours in docs

The preset spread `tokens.color` (which now merges flat semantic colour
tokens) into `colors` and `borderColor`. Unmapped semantic tokens are
`null`, which Tailwind's colour config rejects — breaking `@kaizen/tailwind`
build for the whole branch. Add `stripNulls` to drop null-valued entries
before spreading.

Also update Tailwind guide docs to use the new semantic colour classes:
- utility-class-helpers-overview: border-brand / bg-brand-primary / text-brand-secondary
- overview: fix gray-400 -> blue-400 typo to match anatomy diagram

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Unmapped semantic colour tokens are `null` (no confident mapping yet). Both
CSS-var generators interpolated them into output, emitting literal `null`
values like `--color-bg-primary-alt: null` in variables.css / color.json /
color.less / color.scss.

Add a null-value guard to both makeCSSVariableTheme (color.json/less/scss)
and makeCssVariableDefinitionsMap (variables.css) so null tokens emit nothing.
Regenerate the affected token outputs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Semantic CSS vars were appended to variables.css by build:semantic AFTER
build:json wrote it. Running build:json alone (partial rebuild, watch task)
overwrote the file and silently dropped every semantic --bg-* var, breaking
all semantic Tailwind classes with no error.

build:json now emits the semantic block itself, in the same write, so
variables.css is always complete from one script — no order coupling.
build:semantic no longer touches variables.css; it still writes the
standalone semantic-color.css / .scss. A shared semanticColorCssVariableLines
helper keeps the two outputs from drifting.

Both naming schemes remain (--bg-* for Tailwind, --color-bg-* for SCSS/LESS),
the tokens.color merge is untouched, and consumers need no extra import.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Overview: replace the blue-400 anatomy diagram + CSS block with an inline
  modifier/prefix/suffix breakdown using a semantic example (hover:bg-brand-solid)
  and a note preferring semantic tokens over primitives; remove the now-unused
  tw-anatomy.png asset.
- Utility Class References (Background/Text/Border Color): source the class list
  from the semantic-only extend.{backgroundColor,textColor,borderColor} maps
  instead of the primitive-laden colors/borderColor, so the pages list only
  semantic classes (bg-primary, bg-brand-solid, text-brand-secondary, border-brand…).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fix the three eslint errors in color-tokens.tsx that broke CI:
import order (semanticColorTokens before tokens), prefer-regexp-exec
over String#match, and array-type (T[] over Array<T>). Also run
prettier over buildSemanticTokens.ts and tailwind-presets.ts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…r output

Semantic tokens are merged into `tokens.color` for the JS export and Tailwind
preset, but they leaked into the primitive `color.json` and therefore the
generated `sass/color.scss` and `less/color.less`, surfacing as `$color-bg-*`
entries that reference an undefined `--color-bg-*` variable (the canonical one
is `--bg-*`, emitted separately by build:semantic). Strip semantic keys (both
kebab and camelCase forms) before writing `color.json`, and regenerate the SCSS
and LESS artifacts. Fixes the sass-tokens heart-colour-names unit test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pip-the-concierge

Copy link
Copy Markdown
Contributor

🤖 Agent Workflows

  • PR Review — AI-powered code review

@changeset-bot

changeset-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1c75a40

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@kaizen/components Patch
@kaizen/design-tokens Minor
@kaizen/tailwind Minor

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

@AliceMenzie
AliceMenzie changed the base branch from main to AI-week-semantic July 2, 2026 04:42
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

✨ Here is your branch preview! ✨

Last updated for commit 1c75a40: Merge branch 'main' into AI-week-semanticWithCodemod

@AliceMenzie
AliceMenzie changed the base branch from AI-week-semantic to main July 2, 2026 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants