-
Notifications
You must be signed in to change notification settings - Fork 365
[WB-1998.1] Migrate color to semanticColor in perseus-editor #3244
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: main
Are you sure you want to change the base?
Changes from all commits
c1fa649
fd9f950
049d4f5
285907d
e4c06f3
a7c1843
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-editor": patch | ||
| --- | ||
|
|
||
| Updates WB `color` references to use the new `semanticColor` tokens instead. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| import {color, spacing} from "@khanacademy/wonder-blocks-tokens"; | ||
| import {semanticColor, spacing} from "@khanacademy/wonder-blocks-tokens"; | ||
| import * as React from "react"; | ||
|
|
||
| import DeviceFramer from "../device-framer"; | ||
|
|
@@ -17,8 +17,9 @@ const SampleContent = () => { | |
| return ( | ||
| <div | ||
| style={{ | ||
| backgroundColor: color.blue, | ||
| color: color.offWhite, | ||
| backgroundColor: | ||
| semanticColor.core.background.instructive.default, | ||
| color: semanticColor.core.foreground.knockout.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. note: I changed this on purpose as we no longer use https://khanacademy.atlassian.net/wiki/spaces/WB/pages/4049666283/Core#Knockout.1 |
||
| width: "90%", | ||
| height: "300px", | ||
| padding: spacing.medium_16, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import {View} from "@khanacademy/wonder-blocks-core"; | ||
| import {Strut} from "@khanacademy/wonder-blocks-layout"; | ||
| import {color as wbColor, spacing} from "@khanacademy/wonder-blocks-tokens"; | ||
| import {semanticColor, spacing} from "@khanacademy/wonder-blocks-tokens"; | ||
| import {LabelMedium} from "@khanacademy/wonder-blocks-typography"; | ||
| import {StyleSheet} from "aphrodite"; | ||
| import * as React from "react"; | ||
|
|
@@ -97,8 +97,8 @@ const styles = StyleSheet.create({ | |
| width: spacing.xxxLarge_64, | ||
| }, | ||
| errorField: { | ||
| borderColor: wbColor.red, | ||
| backgroundColor: wbColor.fadedRed8, | ||
| borderColor: semanticColor.core.border.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. |
||
| backgroundColor: semanticColor.core.background.critical.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. |
||
| }, | ||
| }); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ | |
| * If you need to handle `onSubmit`, please use <TextField> directly with your | ||
| * own <form> that wraps all text fields in the form. | ||
| **/ | ||
| import {color, color as WBColor} from "@khanacademy/wonder-blocks-tokens"; | ||
| import {semanticColor} from "@khanacademy/wonder-blocks-tokens"; | ||
| import {StyleSheet, css} from "aphrodite"; | ||
| import * as React from "react"; | ||
|
|
||
|
|
@@ -150,8 +150,8 @@ class FormWrappedTextField extends React.Component<PropsWithForwardRef, State> { | |
| } | ||
|
|
||
| const borderColorStyle = focused | ||
| ? focusBorderColor || WBColor.blue | ||
| : borderColor || WBColor.offBlack16; | ||
| ? focusBorderColor || semanticColor.focus.outer | ||
|
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. |
||
| : borderColor || semanticColor.core.border.neutral.subtle; | ||
| extraStyles.border = `1px solid ${borderColorStyle}`; | ||
|
|
||
| const wrappedIcon = icon && ( | ||
|
|
@@ -234,7 +234,7 @@ const styles = StyleSheet.create({ | |
| marginBottom: 0, | ||
| }, | ||
| defaultBackground: { | ||
| backgroundColor: color.white, | ||
| backgroundColor: semanticColor.core.background.base.default, | ||
| }, | ||
| icon: { | ||
| display: "flex", | ||
|
|
||
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#Instructive-(Progressive)