[WB-1998.2] Migrate color to semanticColor in perseus#3246
[WB-1998.2] Migrate color to semanticColor in perseus#3246jandrade wants to merge 4 commits intowb-color2scfrom
Conversation
…olor` tokens instead of the now deprecated `color` tokens.
🗄️ Schema Change: No Changes ✅ |
|
Size Change: +108 B (+0.02%) Total Size: 485 kB
ℹ️ View Unchanged
|
🛠️ Item Splitting: No Changes ✅ |
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (ff72172) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR3246If you are working in Khan Academy's frontend, you can run the below command. ./dev/tools/bump_perseus_version.ts -t PR3246If 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, |
There was a problem hiding this comment.
| iconActive: { | ||
| border: `2px solid ${semanticColor.core.border.knockout.default}`, | ||
| backgroundColor: color.offBlack64, | ||
| backgroundColor: semanticColor.core.background.neutral.default, |
There was a problem hiding this comment.
| borderStyle: "solid", | ||
| borderWidth: 1, | ||
| borderColor: color.offBlack50, | ||
| borderColor: semanticColor.core.border.neutral.default, |
There was a problem hiding this comment.
| // 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. |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
| title: { | ||
| fontSize: 12, | ||
| color: color.offBlack64, | ||
| color: semanticColor.core.foreground.neutral.subtle, |
There was a problem hiding this comment.
| fill: | ||
| fillStyle === "white" | ||
| ? wbColor.white | ||
| ? semanticColor.core.background.base.default |
There was a problem hiding this comment.
|
|
||
| // Add a shadow to the marker to make it stand out from the image. | ||
| boxShadow: `0 8px 8px ${color.offBlack8}`, | ||
| boxShadow: boxShadow.mid, |
There was a problem hiding this comment.
Summary:
Migrates the Aphrodite styles in the perseus folder to the new
semanticColortokens.
This PR is part of the larger effort to migrate the Perseus codebase to use the
new
semanticColortokens.Documents for reference:
Implementation plan:
Issue: https://khanacademy.atlassian.net/browse/WB-1998
Test plan:
Verify that the components in perseus look correct.