-
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: Refactor Skeleton to use our new styling utilities and new tokens #3088
Conversation
Workday/canvas-kit Run #8212
Run Properties:
|
Project |
Workday/canvas-kit
|
Branch Review |
skeleton
|
Run status |
Passed #8212
|
Run duration | 03m 11s |
Commit |
c31cb0938b ℹ️: Merge af0c7e64a2cb32218e6c7c542742d98eaf22614f into b069877352a0d8b64fe2e045a208...
|
Committer | Thu Nguyen |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
1
|
Pending |
21
|
Skipped |
0
|
Passing |
929
|
View all changes introduced in this branch ↗︎ |
UI Coverage
21.22%
|
|
---|---|
Untested elements |
1528
|
Tested elements |
409
|
Accessibility
99.17%
|
|
---|---|
Failed rules |
6 critical
5 serious
0 moderate
2 minor
|
Failed elements |
162
|
3ee9e6a
to
3851b00
Compare
Updated Upgrade guide note
@@ -18,6 +18,9 @@ any questions. | |||
|
|||
- [Codemod](#codemod) | |||
- [Instructions](#instructions) | |||
- [Component Updates](#component-updates) | |||
- [Styling API and CSS Tokens](#styling-api-and-css-tokens) | |||
- [Skeleton](#skeleton) |
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.
- [Skeleton](#skeleton) |
I think you can remove skeleton, we only add it here if we changed any API stuff, otherwise we lump it into style refactor!
### Skeleton | ||
|
||
**PR** [#2793](https://github.com/Workday/canvas-kit/pull/3088) | ||
|
||
Skeleton has been updated to use our new | ||
[styling utilities](https://workday.github.io/canvas-kit/?path=/docs/styling-basics--create-stencil). |
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.
### Skeleton | |
**PR** [#2793](https://github.com/Workday/canvas-kit/pull/3088) | |
Skeleton has been updated to use our new | |
[styling utilities](https://workday.github.io/canvas-kit/?path=/docs/styling-basics--create-stencil). |
You can update the PR description under release noted to have this info
Skeleton has been updated to use our new
[styling utilities](https://workday.github.io/canvas-kit/?path=/docs/styling-basics--create-stencil).
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.
Sounds good.
base: ({width, backgroundColor, height}) => ({ | ||
backgroundColor: cssVar(backgroundColor, system.color.bg.alt.strong), | ||
borderRadius: 0, | ||
height: cssVar(height, calc.add(system.space.x6, '4px')), |
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.
Should this be px
or rem
?
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.
We also have a token for this as well: system.space.x1
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.
The height is default to 28px
. What should I use here?
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.
Oh i got it. I'm so bad at math 😭
'& [data-part="skeleton-text-lines"]': { | ||
backgroundColor: cssVar(backgroundColor, system.color.bg.alt.strong), | ||
height: px2rem(21), | ||
marginBlockEnd: system.space.x2, |
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.
marginBlockEnd: system.space.x2, | |
marginBlockEnd: system.space.x3, |
backgroundColor: '', | ||
}, | ||
base: ({width, backgroundColor, height}) => ({ | ||
backgroundColor: cssVar(backgroundColor, system.color.bg.alt.strong), |
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.
backgroundColor: cssVar(backgroundColor, system.color.bg.alt.strong), | |
backgroundColor: cssVar(backgroundColor, system.color.bg.alt.soft), |
backgroundColor: '', | ||
}, | ||
base: ({width, height, borderRadius, backgroundColor}) => ({ | ||
backgroundColor: cssVar(backgroundColor, system.color.bg.alt.strong), |
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.
backgroundColor: cssVar(backgroundColor, system.color.bg.alt.strong), | |
backgroundColor: cssVar(backgroundColor, system.color.bg.alt.soft), |
base: ({backgroundColor}) => ({ | ||
marginBottom: system.space.x6, | ||
'& [data-part="skeleton-text-lines"]': { | ||
backgroundColor: cssVar(backgroundColor, system.color.bg.alt.strong), |
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.
backgroundColor: cssVar(backgroundColor, system.color.bg.alt.strong), | |
backgroundColor: cssVar(backgroundColor, system.color.bg.alt.soft), |
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.
Nice work!!!
Summary
Fixes: #2958
Release Category
Components
Release Note
We've updated
Skeleton
to use our new Tokens and styling utilities. The React interface has not changed, but CSS variables are now used for dynamic properties.Checklist
ready for review
has been added to PRFor the Reviewer
Areas for Feedback? (optional)