-
Notifications
You must be signed in to change notification settings - Fork 365
[WB-1998.2] Migrate color to semanticColor in perseus #3246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: wb-color2sc
Are you sure you want to change the base?
Changes from all commits
8d75c8b
a02153b
37dd3e3
ff72172
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@khanacademy/perseus": patch | ||
| --- | ||
|
|
||
| Updates perseus to use WB `semanticColor` tokens instead of the now deprecated `color` tokens. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ import { | |
| import Clickable from "@khanacademy/wonder-blocks-clickable"; | ||
| import {View} from "@khanacademy/wonder-blocks-core"; | ||
| import {Popover, PopoverContentCore} from "@khanacademy/wonder-blocks-popover"; | ||
| import {color, semanticColor, sizing} from "@khanacademy/wonder-blocks-tokens"; | ||
| import {semanticColor, sizing} from "@khanacademy/wonder-blocks-tokens"; | ||
| import {HeadingMedium} from "@khanacademy/wonder-blocks-typography"; | ||
| import {StyleSheet} from "aphrodite"; | ||
| import classNames from "classnames"; | ||
|
|
@@ -550,17 +550,17 @@ const styles = StyleSheet.create({ | |
| }, | ||
| iconInactive: { | ||
| border: "2px solid transparent", | ||
| backgroundColor: color.offBlack8, | ||
| backgroundColor: semanticColor.core.background.neutral.subtle, | ||
| }, | ||
| iconActive: { | ||
| border: `2px solid ${semanticColor.core.border.knockout.default}`, | ||
| backgroundColor: color.offBlack64, | ||
| backgroundColor: semanticColor.core.background.neutral.default, | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| }, | ||
| outerWrapper: { | ||
| display: "inline-block", | ||
| borderStyle: "solid", | ||
| borderWidth: 1, | ||
| borderColor: color.offBlack50, | ||
| borderColor: semanticColor.core.border.neutral.default, | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| borderRadius: 3, | ||
| background: semanticColor.core.background.base.default, | ||
| ":hover": inputFocused, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,9 @@ | |
| */ | ||
| import {color} from "@khanacademy/wonder-blocks-tokens"; | ||
|
|
||
| // 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. | ||
|
Comment on lines
+11
to
+13
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: |
||
| const KhanColors = { | ||
| BLUE: color.blue, | ||
| ORANGE: "#FFA500", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,12 +9,7 @@ import {Text, View} from "@khanacademy/wonder-blocks-core"; | |
| import {TextArea} from "@khanacademy/wonder-blocks-form"; | ||
| import {PhosphorIcon} from "@khanacademy/wonder-blocks-icon"; | ||
| import {LabeledField} from "@khanacademy/wonder-blocks-labeled-field"; | ||
| import { | ||
| color, | ||
| font, | ||
| spacing, | ||
| semanticColor, | ||
| } from "@khanacademy/wonder-blocks-tokens"; | ||
| import {font, spacing, semanticColor} from "@khanacademy/wonder-blocks-tokens"; | ||
| import warningCircleIcon from "@phosphor-icons/core/regular/warning-circle.svg"; | ||
| import {StyleSheet} from "aphrodite"; | ||
| import * as React from "react"; | ||
|
|
@@ -158,7 +153,7 @@ const styles = StyleSheet.create({ | |
| fontSize: font.size.small, | ||
| }, | ||
| overCharacterLimit: { | ||
| color: color.red, | ||
| color: semanticColor.core.foreground.critical.default, | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| }, | ||
| textarea: { | ||
| padding: spacing.medium_16, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| import {linterContextDefault} from "@khanacademy/perseus-linter"; | ||
| import Clickable from "@khanacademy/wonder-blocks-clickable"; | ||
| import {View} from "@khanacademy/wonder-blocks-core"; | ||
| import {color} from "@khanacademy/wonder-blocks-tokens"; | ||
| import {semanticColor} from "@khanacademy/wonder-blocks-tokens"; | ||
| import {StyleSheet, css} from "aphrodite"; | ||
| import classNames from "classnames"; | ||
| import * as React from "react"; | ||
|
|
@@ -263,7 +263,7 @@ const styles = StyleSheet.create({ | |
|
|
||
| title: { | ||
| fontSize: 12, | ||
| color: color.offBlack64, | ||
| color: semanticColor.core.foreground.neutral.subtle, | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| textTransform: "uppercase", | ||
| marginBottom: 11, | ||
| letterSpacing: 0.8, | ||
|
|
@@ -302,7 +302,7 @@ const styles = StyleSheet.create({ | |
| height: 10, | ||
| borderRadius: "100%", | ||
| borderWidth: 2, | ||
| borderColor: color.blue, | ||
| borderColor: semanticColor.core.border.instructive.default, | ||
| borderStyle: "solid", | ||
| }, | ||
|
|
||
|
|
@@ -312,7 +312,7 @@ const styles = StyleSheet.create({ | |
| }, | ||
|
|
||
| indicatorDotActive: { | ||
| backgroundColor: color.blue, | ||
| backgroundColor: semanticColor.core.background.instructive.default, | ||
| width: "100%", | ||
| height: "100%", | ||
| }, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://khanacademy.atlassian.net/wiki/spaces/WB/pages/4049666283/Core#Neutral