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

feat: Refactor Skeleton to use our new styling utilities and new tokens #3088

Merged
merged 4 commits into from
Jan 23, 2025

Conversation

thunguyen19
Copy link
Collaborator

@thunguyen19 thunguyen19 commented Jan 2, 2025

Summary

Fixes: #2958

Release Category

Components

Release Note

We've updatedSkeleton to use our new Tokens and styling utilities. The React interface has not changed, but CSS variables are now used for dynamic properties.


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

Areas for Feedback? (optional)

  • Code
  • Documentation
  • Testing
  • Codemods

@thunguyen19 thunguyen19 marked this pull request as draft January 2, 2025 18:46
Copy link

cypress bot commented Jan 2, 2025

Workday/canvas-kit    Run #8212

Run Properties:  status check passed Passed #8212  •  git commit c31cb0938b ℹ️: Merge af0c7e64a2cb32218e6c7c542742d98eaf22614f into b069877352a0d8b64fe2e045a208...
Project Workday/canvas-kit
Branch Review skeleton
Run status status check passed Passed #8212
Run duration 03m 11s
Commit git commit c31cb0938b ℹ️: Merge af0c7e64a2cb32218e6c7c542742d98eaf22614f into b069877352a0d8b64fe2e045a208...
Committer Thu Nguyen
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
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.22%
  Untested elements 1528  
  Tested elements 409  
Accessibility  99.17%
  Failed rules  6 critical   5 serious   0 moderate   2 minor
  Failed elements 162  

@mannycarrera4 mannycarrera4 changed the title Style Refactor Skeleton chore: Refactor Skeleton to use our new styling utilities and new tokens Jan 2, 2025
@thunguyen19 thunguyen19 changed the title chore: Refactor Skeleton to use our new styling utilities and new tokens feat: Refactor Skeleton to use our new styling utilities and new tokens Jan 9, 2025
@thunguyen19 thunguyen19 changed the title feat: Refactor Skeleton to use our new styling utilities and new tokens chore: Refactor Skeleton to use our new styling utilities and new tokens Jan 9, 2025
@thunguyen19 thunguyen19 force-pushed the skeleton branch 3 times, most recently from 3ee9e6a to 3851b00 Compare January 10, 2025 21:32
@thunguyen19 thunguyen19 changed the title chore: Refactor Skeleton to use our new styling utilities and new tokens feat: Refactor Skeleton to use our new styling utilities and new tokens Jan 14, 2025
@thunguyen19 thunguyen19 marked this pull request as ready for review January 14, 2025 18:29
@@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- [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!

Comment on lines 103 to 108
### 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).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
### 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).

Copy link
Collaborator Author

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')),
Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Collaborator Author

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?

Copy link
Collaborator Author

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,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
marginBlockEnd: system.space.x2,
marginBlockEnd: system.space.x3,

backgroundColor: '',
},
base: ({width, backgroundColor, height}) => ({
backgroundColor: cssVar(backgroundColor, system.color.bg.alt.strong),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
backgroundColor: cssVar(backgroundColor, system.color.bg.alt.strong),
backgroundColor: cssVar(backgroundColor, system.color.bg.alt.soft),

Copy link
Contributor

@mannycarrera4 mannycarrera4 left a comment

Choose a reason for hiding this comment

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

Nice work!!!

@alanbsmith alanbsmith merged commit b5251e8 into Workday:prerelease/major Jan 23, 2025
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants