Skip to content
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

fix: Remove action tokens from CanvasProvider to allow cascading #3125

Merged
merged 2 commits into from
Feb 6, 2025

Conversation

mannycarrera4
Copy link
Contributor

@mannycarrera4 mannycarrera4 commented Feb 6, 2025

Summary

Fixes: #3121

Release Category

Theming

Release Note

The CanvasProvider created a cascading barrier for our brand tokens. In the case where brand.action.** tokens are defined at the root level, say :root in a a CSS file, we want those tokens to cascade through the CanvasProvider down to our PrimaryButton's. To allow this, we've removed them from the CanvasProvider and variables.css.

  • @workday/[email protected] removed --cnvs-brand-action-** tokens from our variables.css to ensure proper cascading of this token to theme our PrimaryButton's.
  • The CanvasProvider has removed defaulting brand.action.** for theming and is longer a valid theme property on CanvasTheme type.
  • In order to ensure proper cascading of the --cnvs-brand-action-** token, you must upgrade to the latest version of Canvas Kit v12 and whomever is bootstrapping the variables.css must upgrade @workday/canvas-tokens-web to @2.1.1 to ensure correct theming.

Checklist

For the Reviewer

  • PR title is short and descriptive
  • PR summary describes the change (Fixes/Resolves linked correctly)
  • PR Release Notes describes additional information useful to call out in a release message or removed if not applicable
  • Breaking Changes provides useful information to upgrade to this code or removed if not applicable

Where Should the Reviewer Start?

Areas for Feedback? (optional)

  • Code
  • Documentation
  • Testing
  • Codemods

Testing Manually

Screenshots or GIFs (if applicable)

Thank You Gif (optional)

Copy link

cypress bot commented Feb 6, 2025

Workday/canvas-kit    Run #8272

Run Properties:  status check passed Passed #8272  •  git commit d7f3369f96 ℹ️: Merge 3a2ca3fe4ee1d07dcf19f0ec4f6929996d2fc2ea into 36cb5e3cb24c43de85acf72a534c...
Project Workday/canvas-kit
Branch Review mc-remove-action-token
Run status status check passed Passed #8272
Run duration 02m 49s
Commit git commit d7f3369f96 ℹ️: Merge 3a2ca3fe4ee1d07dcf19f0ec4f6929996d2fc2ea into 36cb5e3cb24c43de85acf72a534c...
Committer Manuel Carrera
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 21
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 929
View all changes introduced in this branch ↗︎
UI Coverage  21.28%
  Untested elements 1522  
  Tested elements 409  
Accessibility  99.17%
  Failed rules  6 critical   5 serious   0 moderate   2 minor
  Failed elements 162  

@mannycarrera4 mannycarrera4 added the ready for review Code is ready for review label Feb 6, 2025
if (color === 'common') {
(['common', 'primary', 'error', 'alert', 'success', 'neutral'] as const).forEach(color => {
if (color === 'common') {
// @ts-ignore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is TS complaining about here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like a Prettier reformat. 'action' was removed from the array and that shortened the line enough.

@mannycarrera4 mannycarrera4 added approved Code has been reviewed and approved (ship it) automerge and removed ready for review Code is ready for review labels Feb 6, 2025
@alanbsmith alanbsmith merged commit ac7d569 into Workday:master Feb 6, 2025
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Code has been reviewed and approved (ship it) automerge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove brand.action.base from CanvasProvider to ensure proper cascading.
4 participants