Skip to content

🔷 [WB-2322] Add learning.characters.flesh semantic colors#3060

Merged
jandrade merged 11 commits into
mainfrom
WB-2322
Jun 1, 2026
Merged

🔷 [WB-2322] Add learning.characters.flesh semantic colors#3060
jandrade merged 11 commits into
mainfrom
WB-2322

Conversation

@jandrade

@jandrade jandrade commented May 20, 2026

Copy link
Copy Markdown
Member

Summary

Adds a new learning.characters.flesh sub-tree to the semantic color tokens, with 5 color families (blue/cyan/green/magenta/orange) × 3 variants (subtle/default/strong), sourced from the Foundations Figma library. Light themes (default + thunderblocks) share the same Light values; syl-dark uses the inverted Dark values.

Also adds a LearningCharactersFlesh story under Tokens → Semantic Colors → Groups, and a minor changeset for wonder-blocks-tokens.

Reviewers: #frontend-infra-web

Issue: WB-2322

Test plan

  • Open Storybook (pnpm start) → Packages / Tokens / Semantic Colors / Groups / Learning Characters Flesh and confirm 5 colors × 3 variants render with sensible values in both light and dark themes.
  • Automated: pnpm typecheck, pnpm lint, and pnpm jest packages/wonder-blocks-tokens all pass.

Review plan

No high or medium risk changes — all file changes are purely additive to the design tokens (no existing tokens modified), follow the established learning.* shape, and are covered by the token-docs snapshot test.

Common patterns

3 Files: Append a characters.flesh block to the end of the learning tree in each semantic-color theme file. Light themes use *_40 / *_30 / *_10; the dark theme inverts to *_10 / *_30 / *_40.

// inside `learning: { ... }`
characters: {
    flesh: {
        blue:    { subtle: color.blue_40, default: color.blue_30, strong: color.blue_10 },
        cyan:    { subtle: color.cyan_40, default: color.cyan_30, strong: color.cyan_10 },
        green:   { subtle: color.green_40, default: color.green_30, strong: color.green_10 },
        magenta: { subtle: color.magenta_40, default: color.magenta_30, strong: color.magenta_10 },
        orange:  { subtle: color.orange_40, default: color.orange_30, strong: color.orange_10 },
    },
},

🤖 Built using Claude Code #ai-generated

Adds a new `learning.characters.flesh` sub-tree to the semantic color
tokens, with 5 color families (blue/cyan/green/magenta/orange) × 3
variants (subtle/default/strong), sourced from the Foundations Figma
library. Light themes (default + thunderblocks) share the same Light
values; syl-dark uses the inverted Dark values.

Also adds a `LearningCharactersFlesh` story under Tokens → Semantic
Colors → Groups, and a minor changeset for wonder-blocks-tokens.

Reviewers: #frontend-infra-web

Issue: WB-2322

## Test plan:

- Open Storybook (`pnpm start`) → *Packages / Tokens / Semantic Colors
  / Groups / Learning Characters Flesh* and confirm 5 colors × 3
  variants render with sensible values in both light and dark themes.
- Automated: `pnpm typecheck`, `pnpm lint`, and `pnpm jest
  packages/wonder-blocks-tokens` all pass.

## Review plan:

No high or medium risk changes — all file changes are purely additive
to the design tokens (no existing tokens modified), follow the
established `learning.*` shape, and are covered by the token-docs
snapshot test.

### Common patterns:

**3 Files:** Append a `characters.flesh` block to the end of the
`learning` tree in each semantic-color theme file. Light themes use
`*_40 / *_30 / *_10`; the dark theme inverts to `*_10 / *_30 / *_40`.

```ts
// inside `learning: { ... }`
characters: {
    flesh: {
        blue:    { subtle: color.blue_40, default: color.blue_30, strong: color.blue_10 },
        cyan:    { subtle: color.cyan_40, default: color.cyan_30, strong: color.cyan_10 },
        green:   { subtle: color.green_40, default: color.green_30, strong: color.green_10 },
        magenta: { subtle: color.magenta_40, default: color.magenta_30, strong: color.magenta_10 },
        orange:  { subtle: color.orange_40, default: color.orange_30, strong: color.orange_10 },
    },
},
```

🤖 Built using Claude Code #ai-generated
@changeset-bot

changeset-bot Bot commented May 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8f816d1

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

This PR includes changesets to release 31 packages
Name Type
@khanacademy/wonder-blocks-tokens Minor
@khanacademy/wonder-blocks-accordion Patch
@khanacademy/wonder-blocks-badge Patch
@khanacademy/wonder-blocks-banner Patch
@khanacademy/wonder-blocks-birthday-picker Patch
@khanacademy/wonder-blocks-breadcrumbs Patch
@khanacademy/wonder-blocks-button Patch
@khanacademy/wonder-blocks-card Patch
@khanacademy/wonder-blocks-cell Patch
@khanacademy/wonder-blocks-clickable Patch
@khanacademy/wonder-blocks-date-picker Patch
@khanacademy/wonder-blocks-dropdown Patch
@khanacademy/wonder-blocks-form Patch
@khanacademy/wonder-blocks-grid Patch
@khanacademy/wonder-blocks-icon-button Patch
@khanacademy/wonder-blocks-icon Patch
@khanacademy/wonder-blocks-labeled-field Patch
@khanacademy/wonder-blocks-layout Patch
@khanacademy/wonder-blocks-link Patch
@khanacademy/wonder-blocks-modal Patch
@khanacademy/wonder-blocks-pill Patch
@khanacademy/wonder-blocks-popover Patch
@khanacademy/wonder-blocks-progress-spinner Patch
@khanacademy/wonder-blocks-search-field Patch
@khanacademy/wonder-blocks-styles Patch
@khanacademy/wonder-blocks-switch Patch
@khanacademy/wonder-blocks-tabs Patch
@khanacademy/wonder-blocks-toolbar Patch
@khanacademy/wonder-blocks-tooltip Patch
@khanacademy/wonder-blocks-typography Patch
eslint-plugin-wonder-blocks-demo Patch

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

@github-actions

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Size Change: +45 B (+0.03%)

Total Size: 129 kB

📦 View Changed
Filename Size Change
packages/wonder-blocks-tokens/dist/es/index.js 5.4 kB +45 B (+0.84%)
ℹ️ View Unchanged
Filename Size
packages/eslint-plugin-wonder-blocks/dist/es/index.js 7.18 kB
packages/wonder-blocks-accordion/dist/es/index.js 3.02 kB
packages/wonder-blocks-announcer/dist/es/index.js 2.43 kB
packages/wonder-blocks-badge/dist/es/index.js 2.03 kB
packages/wonder-blocks-banner/dist/es/index.js 2.01 kB
packages/wonder-blocks-birthday-picker/dist/es/index.js 1.93 kB
packages/wonder-blocks-breadcrumbs/dist/es/index.js 761 B
packages/wonder-blocks-button/dist/es/index.js 4.28 kB
packages/wonder-blocks-card/dist/es/index.js 1.09 kB
packages/wonder-blocks-cell/dist/es/index.js 2.19 kB
packages/wonder-blocks-clickable/dist/es/index.js 2.61 kB
packages/wonder-blocks-core/dist/es/index.js 2.6 kB
packages/wonder-blocks-data/dist/es/index.js 5.48 kB
packages/wonder-blocks-date-picker/dist/es/index.js 8.06 kB
packages/wonder-blocks-dropdown/dist/es/index.js 19.7 kB
packages/wonder-blocks-form/dist/es/index.js 6.32 kB
packages/wonder-blocks-grid/dist/es/index.js 1.25 kB
packages/wonder-blocks-icon-button/dist/es/index.js 4.01 kB
packages/wonder-blocks-icon/dist/es/index.js 1.91 kB
packages/wonder-blocks-labeled-field/dist/es/index.js 3.47 kB
packages/wonder-blocks-layout/dist/es/index.js 1.69 kB
packages/wonder-blocks-link/dist/es/index.js 1.54 kB
packages/wonder-blocks-modal/dist/es/index.js 7.36 kB
packages/wonder-blocks-pill/dist/es/index.js 1.31 kB
packages/wonder-blocks-popover/dist/es/index.js 4.41 kB
packages/wonder-blocks-progress-spinner/dist/es/index.js 1.48 kB
packages/wonder-blocks-search-field/dist/es/index.js 1.1 kB
packages/wonder-blocks-styles/dist/es/index.js 464 B
packages/wonder-blocks-switch/dist/es/index.js 1.55 kB
packages/wonder-blocks-tabs/dist/es/index.js 5.66 kB
packages/wonder-blocks-testing-core/dist/es/index.js 3.25 kB
packages/wonder-blocks-testing/dist/es/index.js 978 B
packages/wonder-blocks-theming/dist/es/index.js 384 B
packages/wonder-blocks-timing/dist/es/index.js 1.53 kB
packages/wonder-blocks-toolbar/dist/es/index.js 921 B
packages/wonder-blocks-tooltip/dist/es/index.js 6.06 kB
packages/wonder-blocks-typography/dist/es/index.js 1.58 kB

compressed-size-action

@github-actions

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

npm Snapshot: Published

🎉 Good news!! We've packaged up the latest commit from this PR (34d103f) and published all packages with changesets to npm.

You can install the packages in frontend by running:

./dev/tools/deploy_wonder_blocks.js --tag="PR3060"

Packages can also be installed manually by running:

pnpm add @khanacademy/wonder-blocks-<package-name>@PR3060

@github-actions

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

A new build was pushed to Chromatic! 🚀

https://5e1bf4b385e3fb0020b7073c-ntaccmicqi.chromatic.com/

Chromatic results:

Metric Total
Captured snapshots 3
Tests with visual changes 0
Total stories 846
Inherited (not captured) snapshots [TurboSnap] 476
Tests on the build 479

Juan Andrade added 4 commits May 20, 2026 16:28
Drop `subtle` and `strong` variants. Each color now exposes a single
`default` token (matches existing patterns like
`learning.background.progress.notStarted.default`).

🤖 Built using Claude Code #ai-generated
Comment on lines +78 to +82
const publicTokens = Object.fromEntries(
Object.entries(flattenNestedTokens(semanticColor)).filter(
([key, _]) => !key.includes("action.") || key.includes("status."),
),
);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: I've filtered out deprecated tokens from the final list so we prevent a Chromatic issue.

https://www.chromatic.com/test?appId=5e1bf4b385e3fb0020b7073c&id=6a0e1ab4ebedee0f3d56cc77

Your story couldn’t be captured because it exceeds our 25,000,000px limit. Its dimensions are 1,184x21,129px. Check that your story renders correctly in your published Storybook. Possible ways to resolve:
Separate pages into components
Minimize the number of very large elements in a story

@jandrade jandrade marked this pull request as ready for review May 21, 2026 18:39
@codecov

codecov Bot commented May 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (ad92408) to head (329de8d).

Additional details and impacted files

Impacted file tree graph

@@     Coverage Diff      @@
##   main   #3060   +/-   ##
============================
============================

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad92408...329de8d. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@khan-actions-bot khan-actions-bot requested a review from a team May 21, 2026 18:40

@beaesguerra beaesguerra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, looks good! Thanks for adding these tokens!

);
};

export const LearningCharactersFlesh = () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to reference this in the Using color docs? https://5e1bf4b385e3fb0020b7073c-pwitftghie.chromatic.com/?path=/docs/foundations-using-color--docs

(Referencing these semantic-color-groups stories was how we made it so the color swatches and values would adapt based on the theme set in Storybook!)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed! thanks for pointing this out 🫶

default: thunderBlocksColor.orange_30,
},
},
},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious, did you use Claude with the Figma MCP?

I've only tried using the Figma MCP with links to a selection in the canvas, and not the variables directly! Or by exporting the Figma variables and working with that file instead :) I've been wondering about how we can use the Figma MCP more!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I could have used the MCP, but ended up giving Claude this screenshot 😄

Screenshot 2026-05-20 at 3 29 42 PM

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I think, the Figma link would not work with variables as they don't support permalinks yet 🤔, so the screenshot definitively helped in this case.

@beaesguerra

Copy link
Copy Markdown
Member

Just reviewed the Chromatic snapshots, looks like the status tokens are still included in the semantic color tokens table!

@jandrade

jandrade commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

@beaesguerra I've fixed the snapshots, let me know if you find something else missing

@beaesguerra

Copy link
Copy Markdown
Member

@beaesguerra I've fixed the snapshots, let me know if you find something else missing

@jandrade looks good to me, approved the snapshots!

@jandrade jandrade merged commit a676ce6 into main Jun 1, 2026
14 of 15 checks passed
@jandrade jandrade deleted the WB-2322 branch June 1, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants