Skip to content

Commit aa6ad92

Browse files
authored
WB-2050(part1): Tokens update - Add knockout tokens and replace foreground.inverse.* and border.inverse.* usage (#2758)
## Summary: - Introducing `border.knockout.default` and `foreground.knockout.default` tokens. This will replace `border.inverse.*` and `foreground.inverse.*` tokens to align with the recent design token changes (the inverse tokens will be removed in a future update once existing usage of these tokens have moved to the new token structure) - Updating existing usage of `border.inverse.*` and `foreground.inverse.*` tokens in WB Token Mapping: | Before | After | | --- | --- | | `foreground.inverse.strong` | `foreground.knockout.default` | | `border.inverse.strong` | `border.knockout.default` | For `foreground.inverse.subtle/default` and `border.inverse.subtle/default` the mapping will either map to a `neutral` or `disabled` value depending on the use case Issue: WB-2050 Design: [Core Tokens](https://www.figma.com/design/e9qdyiDUBZ3rDabP9S7ulO/%E2%9A%A1%EF%B8%8F-Handshake?node-id=3040-15158&m=dev) ## Test plan: - Confirm the `foreground.knockout.default` and `border.knockout.default` tokens exist (`?path=/docs/foundations-using-color--docs`) - Confirm the `foreground.inverse.*` and `border.inverse.*` tokens have not been removed - Most things should look the same. For any components that have any changes, confirm they are intentional (I noted the expected changes in Chromatic) ## Implementation plan 1. Add knockout tokens (#2758) 2. Add background base and overlay tokens 3. Update usage (in WB and other repos) - Replace foreground and border inverse tokens usage in other repos - Replace surface tokens with background base tokens - Use background.base.default token for white instead of background.neutral.subtle 4. Update background.neutral.subtle to light gray 5. Remove surface and inverse tokens Author: beaesguerra Reviewers: beaesguerra, marcysutton Required Reviewers: Approved By: marcysutton Checks: ✅ 49 checks were successful, ⏭️ 11 checks have been skipped, ⏹️ 5 checks were cancelled Pull Request URL: #2758
1 parent 31135ce commit aa6ad92

File tree

25 files changed

+124
-84
lines changed

25 files changed

+124
-84
lines changed

.changeset/few-carrots-cough.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@khanacademy/wonder-blocks-tokens": patch
3+
"@khanacademy/wonder-blocks-cell": patch
4+
---
5+
6+
Add themed component tokens for Cell for it's disabled state

.changeset/hungry-bananas-grow.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
"@khanacademy/wonder-blocks-clickable": patch
3+
"@khanacademy/wonder-blocks-toolbar": patch
4+
"@khanacademy/wonder-blocks-styles": patch
5+
"@khanacademy/wonder-blocks-switch": patch
6+
"@khanacademy/wonder-blocks-cell": patch
7+
"@khanacademy/wonder-blocks-form": patch
8+
"@khanacademy/wonder-blocks-link": patch
9+
"@khanacademy/wonder-blocks-pill": patch
10+
---
11+
12+
Move away from using `foreground.inverse` and `border.inverse` tokens in favour of the new knockout tokens

.changeset/silent-bikes-cheer.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@khanacademy/wonder-blocks-tokens": minor
3+
---
4+
5+
Adds `foreground.knockout.default` and `border.knockout.default` semantic core colors. Tokens that were previously using `foreground.inverse.*` and `border.inverse.*` have been updated to use the knockout token or other core tokens

__docs__/wonder-blocks-badge/badge-testing-snapshots.stories.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,14 +359,14 @@ export const AllBadgesScenarios: StoryComponentType = {
359359
backgroundColor:
360360
semanticColor.surface.inverse,
361361
borderColor:
362-
semanticColor.core.border.inverse
363-
.strong,
362+
semanticColor.core.border.knockout
363+
.default,
364364
color: semanticColor.core.foreground
365-
.inverse.strong,
365+
.knockout.default,
366366
},
367367
icon: {
368368
color: semanticColor.core.foreground
369-
.inverse.strong,
369+
.knockout.default,
370370
},
371371
label: {
372372
fontWeight: font.weight.medium,

__docs__/wonder-blocks-badge/badge.stories.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,12 @@ export const CustomStyles: StoryComponentType = {
198198
styles={{
199199
root: {
200200
backgroundColor: semanticColor.surface.inverse,
201-
borderColor: semanticColor.core.border.inverse.strong,
202-
color: semanticColor.core.foreground.inverse.strong,
201+
borderColor: semanticColor.core.border.knockout.default,
202+
color: semanticColor.core.foreground.knockout.default,
203+
},
204+
icon: {
205+
color: semanticColor.core.foreground.knockout.default,
203206
},
204-
icon: {color: semanticColor.core.foreground.inverse.strong},
205207
label: {
206208
fontWeight: font.weight.medium,
207209
},

__docs__/wonder-blocks-banner/banner.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export const Kinds: StoryComponentType = {
132132
*/
133133
export const Layouts: StoryComponentType = () => {
134134
const borderStyle = {
135-
border: `${border.width.medium} solid ${semanticColor.core.border.inverse.strong}`,
135+
border: `${border.width.medium} solid ${semanticColor.core.border.knockout.default}`,
136136
} as const;
137137
const floatingContainerStyle = {padding: sizing.size_080} as const;
138138

__docs__/wonder-blocks-cell/compact-cell.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,12 @@ export const CompactCellWithCustomStyles: StoryComponentType = {
234234
rightAccessory={
235235
<PhosphorIcon
236236
icon={IconMappings.calendar}
237-
color={semanticColor.core.foreground.inverse.strong}
237+
color={semanticColor.core.foreground.knockout.default}
238238
/>
239239
}
240240
style={{
241241
background: semanticColor.surface.inverse,
242-
color: semanticColor.core.foreground.inverse.strong,
242+
color: semanticColor.core.foreground.knockout.default,
243243
}}
244244
onClick={() => {}}
245245
/>

__docs__/wonder-blocks-clickable/clickable.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ const styles = StyleSheet.create({
337337
},
338338
dark: {
339339
backgroundColor: semanticColor.surface.inverse,
340-
color: semanticColor.core.foreground.inverse.strong,
340+
color: semanticColor.core.foreground.knockout.default,
341341
padding: spacing.xSmall_8,
342342
},
343343
row: {
@@ -353,7 +353,7 @@ const styles = StyleSheet.create({
353353
padding: spacing.large_24,
354354
},
355355
disabled: {
356-
color: semanticColor.core.foreground.inverse.strong,
356+
color: semanticColor.core.foreground.knockout.default,
357357
backgroundColor: semanticColor.surface.overlay,
358358
},
359359
button: {

__docs__/wonder-blocks-link/link.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ export const StartAndEndIcons: StoryComponentType = {
248248
</Link>
249249
<Body
250250
style={{
251-
color: semanticColor.core.foreground.inverse.strong,
251+
color: semanticColor.core.foreground.knockout.default,
252252
}}
253253
>
254254
This is an inline{" "}
@@ -325,7 +325,7 @@ export const InlineLight: StoryComponentType = {
325325
render: () => (
326326
<Body
327327
style={{
328-
color: semanticColor.core.foreground.inverse.strong,
328+
color: semanticColor.core.foreground.knockout.default,
329329
width: 530,
330330
}}
331331
>

__docs__/wonder-blocks-pill/pill.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ WithTypography.parameters = {
235235
export const WithStyle: StoryComponentType = () => {
236236
const customStyle = {
237237
backgroundColor: tokens.semanticColor.surface.inverse,
238-
color: tokens.semanticColor.core.foreground.inverse.strong,
238+
color: tokens.semanticColor.core.foreground.knockout.default,
239239
paddingLeft: tokens.spacing.xxLarge_48,
240240
paddingRight: tokens.spacing.xxLarge_48,
241241

0 commit comments

Comments
 (0)