fix: Remove old tokens#3768
Open
RayRedGoose wants to merge 11 commits intoWorkday:prerelease/majorfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Removes deprecated @workday/canvas-kit-react/tokens usages (and some legacy style-props patterns) by migrating examples/components/docs to @workday/canvas-tokens-web tokens and the cs/stencil styling utilities.
Changes:
- Replaces deprecated token imports (
colors,space,type, etc.) withsystem/basetokens andcs-based styling across stories/examples. - Adds/propagates
CSPropshandling (e.g., Tooltip now consumescssafely viahandleCsProp) and updates related components to acceptcs. - Updates docs widgets/components to use new tokens and styling approach.
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/create-component/templates/react/component.content.js | Updates component generator template to use stencil/cs styling instead of deprecated tokens. |
| modules/react/tooltip/stories/examples/Ellipsis.tsx | Replaces deprecated spacing/width tokens with px2rem/cs usage. |
| modules/react/tooltip/lib/Tooltip.tsx | Adds CSProps support and routes cs through handleCsProp. |
| modules/react/toast/stories/examples/WithPopper.tsx | Replaces icon color token usage with system token via cs. |
| modules/react/toast/stories/examples/WithActionLinkAndCloseIcon.tsx | Replaces icon color token usage with system token via cs. |
| modules/react/toast/stories/examples/ToastAlert.tsx | Replaces icon color token usage with system token via cs. |
| modules/react/toast/stories/examples/RTL.tsx | Replaces icon color token usage with system token via cs. |
| modules/react/toast/spec/Toast.spec.tsx | Updates test to use system token via cs for icon color. |
| modules/react/tabs/stories/examples/SinglePanel.tsx | Migrates margin styling from deprecated tokens to system via cs. |
| modules/react/tabs/stories/examples/RightToLeft.tsx | Migrates margin styling to system and uses cssVar where needed. |
| modules/react/tabs/stories/examples/NamedTabs.tsx | Migrates margin styling to system and uses cssVar where needed. |
| modules/react/tabs/stories/examples/Icons.tsx | Migrates margin styling to system and uses cssVar where needed. |
| modules/react/tabs/stories/examples/HoistedModel.tsx | Migrates margin styling to system and uses cssVar where needed. |
| modules/react/tabs/stories/examples/DisabledTab.tsx | Migrates margin styling to system and uses cssVar where needed. |
| modules/react/tabs/stories/examples/Basic.tsx | Migrates margin styling to system and uses cssVar where needed. |
| modules/react/tabs/stories/examples/AlternativeTabStop.tsx | Migrates margin styling to system and uses cssVar where needed. |
| modules/react/status-indicator/stories/examples/MaxWidth.tsx | Replaces spacing token usage with system + cssVar. |
| modules/react/status-indicator/stories/examples/Emphasis.tsx | Removes unused React import, but still contains deprecated spacing tokens. |
| modules/react/skeleton/stories/examples/Simulation.tsx | Migrates layout/spacing/shape tokens to system and uses cs styling. |
| modules/react/skeleton/stories/examples/Shape.tsx | Migrates sizing/border-radius tokens to system via cs. |
| modules/react/skeleton/stories/examples/Color.tsx | Migrates colors/sizing to base/system via cs. |
| modules/react/skeleton/stories/examples/Basic.tsx | Migrates sizing/spacing to system via cs. |
| modules/react/skeleton/lib/parts/SkeletonText.tsx | Extends props with CSProps to support cs. |
| modules/react/popup/stories/visual-testing/Popper.stories.tsx | Migrates token styling to system + createStyles/cs. |
| modules/react/popup/lib/PopupCard.tsx | Replaces deprecated space token lookup with a system mapping. |
| modules/react/layout/stories/examples/Grid/GridCard.tsx | Migrates styling to system + createStyles/cs. |
| modules/react/button/stories/visual-testing/Hyperlink.stories.tsx | Migrates typography/colors to system via cs. |
| modules/react/action-bar/stories/visual-testing/testing.stories.tsx | Migrates colors/sizing to base/px2rem/cs. |
| modules/docs/lib/widgets/canvasColor.tsx | Switches docs color widget from deprecated tokens to base tokens. |
| modules/docs/lib/widgetUtils.tsx | Migrates syntax highlighting styles from deprecated tokens to stencils + system/base. |
| modules/docs/lib/Value.tsx | Migrates deprecated colors and some styling props to cs + system/base. |
| modules/docs/lib/Table.tsx | Replaces token-based styling props with stencil-based cs styling. |
| modules/docs/lib/DescriptionTooltip.tsx | Replaces token-based Tooltip styling with cs + system tokens. |
Comments suppressed due to low confidence (1)
modules/react/status-indicator/stories/examples/Emphasis.tsx:9
- This example still uses deprecated tokens via
space.xxs. Since this PR is about removing old tokens/style-props usage, this file should be migrated tosystemtokens (orcssVar(system.gap.*)depending on the styling API) and the@workday/canvas-kit-react/tokensimport removed.
import styled from '@emotion/styled';
import {StatusIndicator} from '@workday/canvas-kit-react/status-indicator';
import {space} from '@workday/canvas-kit-react/tokens';
const StatusIndicators = styled('div')({
'& > *': {
margin: space.xxs,
},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Workday/canvas-kit
|
||||||||||||||||||||||||||||||||||||||||
| Project |
Workday/canvas-kit
|
| Branch Review |
ISSUE3536-old-tokens-removal
|
| Run status |
|
| Run duration | 02m 21s |
| Commit |
|
| Committer | Raisa Primerova |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
15
|
|
|
0
|
|
|
802
|
| View all changes introduced in this branch ↗︎ | |
UI Coverage
19.36%
|
|
|---|---|
|
|
1531
|
|
|
365
|
Accessibility
99.38%
|
|
|---|---|
|
|
5 critical
5 serious
0 moderate
2 minor
|
|
|
72
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…RedGoose/canvas-kit into ISSUE3536-old-tokens-removal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes: #3536
Release Category
Components
Checklist
ready for reviewhas been added to PRFor the Reviewer
Where Should the Reviewer Start?
Areas for Feedback? (optional)
Testing Manually
Screenshots or GIFs (if applicable)
Thank You Gif (optional)