Skip to content

[WB-1998.1] Migrate color to semanticColor in perseus-editor#3244

Open
jandrade wants to merge 6 commits intomainfrom
wb-color2sc
Open

[WB-1998.1] Migrate color to semanticColor in perseus-editor#3244
jandrade wants to merge 6 commits intomainfrom
wb-color2sc

Conversation

@jandrade
Copy link
Member

@jandrade jandrade commented Feb 11, 2026

Summary:

Migrates the Aphrodite styles in perseus-editor to the new semanticColor
tokens.

This PR is part of the larger effort to migrate the Perseus codebase to use the
new semanticColor tokens.

Documents for reference:

Implementation plan:

1. perseus-editor (current PR)
2. #3246
3. #3250

Issue: https://khanacademy.atlassian.net/browse/WB-1998

Test plan:

Verify that the components in perseus-editor look correct.

@jandrade jandrade self-assigned this Feb 11, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 11, 2026

🗄️ Schema Change: No Changes ✅

@github-actions
Copy link
Contributor

github-actions bot commented Feb 11, 2026

🛠️ Item Splitting: No Changes ✅

@github-actions
Copy link
Contributor

github-actions bot commented Feb 11, 2026

Size Change: +107 B (+0.02%)

Total Size: 484 kB

Filename Size Change
packages/perseus-editor/dist/es/index.js 99.3 kB +107 B (+0.11%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 20.8 kB
packages/keypad-context/dist/es/index.js 1 kB
packages/kmath/dist/es/index.js 5.98 kB
packages/math-input/dist/es/index.js 98.5 kB
packages/math-input/dist/es/strings.js 1.61 kB
packages/perseus-core/dist/es/index.item-splitting.js 11.8 kB
packages/perseus-core/dist/es/index.js 24.8 kB
packages/perseus-linter/dist/es/index.js 8.83 kB
packages/perseus-score/dist/es/index.js 9.26 kB
packages/perseus-utils/dist/es/index.js 403 B
packages/perseus/dist/es/index.js 187 kB
packages/perseus/dist/es/strings.js 7.44 kB
packages/pure-markdown/dist/es/index.js 1.39 kB
packages/simple-markdown/dist/es/index.js 6.71 kB

compressed-size-action

@github-actions
Copy link
Contributor

github-actions bot commented Feb 11, 2026

npm Snapshot: Published

Good news!! We've packaged up the latest commit from this PR (a7c1843) and published it to npm. You
can install it using the tag PR3244.

Example:

pnpm add @khanacademy/perseus@PR3244

If you are working in Khan Academy's frontend, you can run the below command.

./dev/tools/bump_perseus_version.ts -t PR3244

If you are working in Khan Academy's webapp, you can run the below command.

./dev/tools/bump_perseus_version.js -t PR3244

style={{
backgroundColor: color.blue,
color: color.offWhite,
backgroundColor:
Copy link
Member Author

Choose a reason for hiding this comment

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

color: color.offWhite,
backgroundColor:
semanticColor.core.background.instructive.default,
color: semanticColor.core.foreground.knockout.default,
Copy link
Member Author

Choose a reason for hiding this comment

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

note: I changed this on purpose as we no longer use offWhite for foreground colors (text/icon color). This also improves color contrast.

https://khanacademy.atlassian.net/wiki/spaces/WB/pages/4049666283/Core#Knockout.1

errorField: {
borderColor: wbColor.red,
backgroundColor: wbColor.fadedRed8,
borderColor: semanticColor.core.border.critical.default,
Copy link
Member Author

Choose a reason for hiding this comment

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

borderColor: wbColor.red,
backgroundColor: wbColor.fadedRed8,
borderColor: semanticColor.core.border.critical.default,
backgroundColor: semanticColor.core.background.critical.subtle,
Copy link
Member Author

Choose a reason for hiding this comment

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

const borderColorStyle = focused
? focusBorderColor || WBColor.blue
: borderColor || WBColor.offBlack16;
? focusBorderColor || semanticColor.focus.outer
Copy link
Member Author

Choose a reason for hiding this comment

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

// Add a white outline so that the color swatch is visible when
// the dropdown option is highlighted with its blue background.
outline: `2px solid ${wbColor.offWhite}`,
outline: `2px solid ${semanticColor.focus.inner}`,
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

note: We now use white instead of offWhite at the system level.

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.

1 participant