Skip to content

[WB-1998.2] Migrate color to semanticColor in perseus#3246

Open
jandrade wants to merge 4 commits intowb-color2scfrom
wb-color2sc-2
Open

[WB-1998.2] Migrate color to semanticColor in perseus#3246
jandrade wants to merge 4 commits intowb-color2scfrom
wb-color2sc-2

Conversation

@jandrade
Copy link
Member

Summary:

Migrates the Aphrodite styles in the perseus folder 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. [WB-1998.1] Migrate color to semanticColor in perseus-editor #3244
  2. perseus (current PR)
  3. math-input

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

Test plan:

Verify that the components in perseus 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

Size Change: +108 B (+0.02%)

Total Size: 485 kB

Filename Size Change
packages/perseus/dist/es/index.js 187 kB +108 B (+0.06%)
ℹ️ 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-editor/dist/es/index.js 99.3 kB
packages/perseus-linter/dist/es/index.js 8.83 kB
packages/perseus-score/dist/es/index.js 9.32 kB
packages/perseus-utils/dist/es/index.js 403 B
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

🛠️ Item Splitting: No Changes ✅

@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 (ff72172) and published it to npm. You
can install it using the tag PR3246.

Example:

pnpm add @khanacademy/perseus@PR3246

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

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

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

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

iconInactive: {
border: "2px solid transparent",
backgroundColor: color.offBlack8,
backgroundColor: semanticColor.core.background.neutral.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.

iconActive: {
border: `2px solid ${semanticColor.core.border.knockout.default}`,
backgroundColor: color.offBlack64,
backgroundColor: semanticColor.core.background.neutral.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.

borderStyle: "solid",
borderWidth: 1,
borderColor: color.offBlack50,
borderColor: semanticColor.core.border.neutral.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.

Comment on lines +11 to +13
// TODO(WB-2160): Update these to use the new semanticColor tokens, and use the
// new tokenValue() function to get the raw value of the token. This is
// necessary because graphie only supports raw CSS colors.
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: Left this comment as I'm planning to come back to this later. As you are aware, Graphie doesn't support CSS variable references, so I'm planning to do something like this:

BLUE: tokenValue(semanticColor.core.foreground.instructive.default), // outputs the HEX value of that token

},
overCharacterLimit: {
color: color.red,
color: semanticColor.core.foreground.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.

title: {
fontSize: 12,
color: color.offBlack64,
color: semanticColor.core.foreground.neutral.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.

fill:
fillStyle === "white"
? wbColor.white
? semanticColor.core.background.base.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.


// Add a shadow to the marker to make it stand out from the image.
boxShadow: `0 8px 8px ${color.offBlack8}`,
boxShadow: boxShadow.mid,
Copy link
Member Author

Choose a reason for hiding this comment

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

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