-
Notifications
You must be signed in to change notification settings - Fork 221
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
feat: Add action tokens to PrimaryButton with brand base as fallback #3081
Open
mannycarrera4
wants to merge
10
commits into
Workday:prerelease/minor
Choose a base branch
from
mannycarrera4:mc-action-tokens
base: prerelease/minor
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: Add action tokens to PrimaryButton with brand base as fallback #3081
mannycarrera4
wants to merge
10
commits into
Workday:prerelease/minor
from
mannycarrera4:mc-action-tokens
Conversation
This file contains 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
Workday/canvas-kit Run #8183
Run Properties:
|
Project |
Workday/canvas-kit
|
Branch Review |
mc-action-tokens
|
Run status |
Passed #8183
|
Run duration | 02m 49s |
Commit |
e32b55a133 ℹ️: Merge fe627c493cd75a6fe90c1eda1c1776939d43753c into 340f917ae60082f246c1ac420140...
|
Committer | Manuel Carrera |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
21
|
Skipped |
0
|
Passing |
929
|
View all changes introduced in this branch ↗︎ |
UI Coverage
21.24%
|
|
---|---|
Untested elements |
1522
|
Tested elements |
408
|
Accessibility
99.17%
|
|
---|---|
Failed rules |
6 critical
5 serious
0 moderate
2 minor
|
Failed elements |
162
|
mannycarrera4
commented
Jan 8, 2025
|
||
const mergeable: PartialCanvasTheme = { | ||
palette: { | ||
common, | ||
primary: fillPalette(defaultCanvasTheme.palette.primary, primary), | ||
action: fillPalette(defaultCanvasTheme.palette.primary, action || primary), |
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.
This bit of code allows for consumers just to define primary
and not require them to define action
.
The below code when passed to canvas provider will work, with action not being defined.
const customColorTheme: PartialCanvasTheme = {
palette: {
primary: {
main: 'purple',
contrast: 'turquoise',
},
error: {
main: 'crimson',
},
success: {
main: 'aquamarine',
},
neutral: {
main: 'gray',
},
common: {
focusOutline: 'turquoise',
},
},
};
If you pass the following, action
will win
const customColorThemeWithAction: PartialCanvasTheme = {
palette: {
primary: {
main: 'purple',
contrast: 'turquoise',
},
action: {
main: 'red',
},
error: {
main: 'crimson',
},
success: {
main: 'aquamarine',
},
neutral: {
main: 'gray',
},
common: {
focusOutline: 'turquoise',
},
},
};
josh-bagwell
reviewed
Jan 8, 2025
josh-bagwell
reviewed
Jan 8, 2025
josh-bagwell
reviewed
Jan 8, 2025
Co-authored-by: Josh <44883293+josh-bagwell@users.noreply.github.com>
josh-bagwell
approved these changes
Jan 8, 2025
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: #3072
Release Category
Components
Release Note
In
@workday/canvas-tokens-web@2.1.0
we've added newaction
tokens. In most cases you'll usebrand.primary.**
tokens to override theme. However, in the unique cases where you need additional control. over stylingPrimaryButton
you can overridebrand.action.**
tokens for more control. This PR ensures thatPrimaryButton
uses the newaction
tokens withbrand.base.**
being a fallback token. There should be no breaking changes as this is an addition to provide more control of theming ourPrimaryButton
component.Note: If
band.action.**
token is defined anywhere at the root level, Primary Buttons will receive that color instead ofbrand.primary.*
.Checklist
ready for review
has 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)