-
Notifications
You must be signed in to change notification settings - Fork 365
[WB-1998.3] Migrate color to semanticColor in math-input #3250
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-2
Are you sure you want to change the base?
Changes from all commits
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/math-input": patch | ||
| --- | ||
|
|
||
| Updates MathInput to use `semanticColor` tokens instead of the now deprecated WB color tokens. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| /* eslint-disable max-lines */ | ||
| import {KeypadContext} from "@khanacademy/keypad-context"; | ||
| import {View} from "@khanacademy/wonder-blocks-core"; | ||
| import {color} from "@khanacademy/wonder-blocks-tokens"; | ||
| import {semanticColor} from "@khanacademy/wonder-blocks-tokens"; | ||
| import {entries} from "@khanacademy/wonder-stuff-core"; | ||
| import {StyleSheet} from "aphrodite"; | ||
| import * as React from "react"; | ||
|
|
@@ -921,7 +921,8 @@ class MathInput extends React.Component<Props, State> { | |
| borderWidth: this.getBorderWidthPx(), | ||
| ...(showInputFocusStyle | ||
| ? { | ||
| borderColor: color.blue, | ||
| borderColor: | ||
| semanticColor.core.border.instructive.default, | ||
| } | ||
| : {}), | ||
| ...style, | ||
|
|
@@ -1043,9 +1044,9 @@ const inlineStyles = { | |
| boxSizing: "border-box", | ||
| position: "relative", | ||
| borderStyle: "solid", | ||
| 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: 4, | ||
| color: color.offBlack, | ||
| color: semanticColor.core.foreground.neutral.strong, | ||
|
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. |
||
| }, | ||
| } as const; | ||
|
|
||
|
|
||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| import {Popover, PopoverContentCore} from "@khanacademy/wonder-blocks-popover"; | ||
| import {color} from "@khanacademy/wonder-blocks-tokens"; | ||
| import {semanticColor} from "@khanacademy/wonder-blocks-tokens"; | ||
| import {render, screen} from "@testing-library/react"; | ||
| import {userEvent as userEventLib} from "@testing-library/user-event"; | ||
| import * as React from "react"; | ||
|
|
@@ -108,7 +108,7 @@ function V2KeypadWithMathquill(props: Props) { | |
| style={{ | ||
| width: "100%", | ||
| marginBottom: "1em", | ||
| border: `1px solid ${color.offBlack16}`, | ||
| border: `1px solid ${semanticColor.core.border.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. |
||
| }} | ||
| ref={mathFieldWrapperRef} | ||
| /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| 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} from "aphrodite"; | ||
| import * as React from "react"; | ||
|
|
||
|
|
@@ -84,9 +84,9 @@ const styles = StyleSheet.create({ | |
| display: "flex", | ||
| justifyContent: "center", | ||
| alignItems: "center", | ||
| boxShadow: `0px 1px 0px ${color.offBlack32}`, | ||
| boxShadow: `0px 1px 0px ${semanticColor.core.shadow.chonky.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. note: I used a
https://khanacademy.atlassian.net/wiki/spaces/WB/pages/4049666283/Core#Neutral.3 |
||
| boxSizing: "border-box", | ||
| background: color.white, | ||
| background: semanticColor.core.background.base.default, | ||
| borderRadius: 4, | ||
| borderWidth: 2, | ||
| borderStyle: "solid", | ||
|
|
@@ -98,19 +98,19 @@ const styles = StyleSheet.create({ | |
| fontFamily: 'Lato, "Noto Sans", sans-serif', | ||
| }, | ||
| hovered: { | ||
| borderColor: color.blue, | ||
| borderColor: semanticColor.core.border.instructive.default, | ||
| padding: 1, | ||
| boxShadow: "none", | ||
| }, | ||
| focused: { | ||
| borderColor: color.blue, | ||
| borderColor: semanticColor.core.border.instructive.default, | ||
| padding: 0, | ||
| boxShadow: "none", | ||
| }, | ||
| pressed: { | ||
| border: "2px solid #1B50B3", | ||
| padding: 0, | ||
| background: `linear-gradient(0deg, rgba(24, 101, 242, 0.32), rgba(24, 101, 242, 0.32)), ${color.white}`, | ||
| background: `linear-gradient(0deg, rgba(24, 101, 242, 0.32), rgba(24, 101, 242, 0.32)), ${semanticColor.core.background.base.default}`, | ||
| boxShadow: "none", | ||
| }, | ||
| outerBoxBase: { | ||
|
|
||

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).1