Repository navigation
[CLOV-CSS] Migrate bpk-component-skeleton to CSS custom properties - #4952
Conversation
- Replace static SASS tokens with CSS var() wrappers in BpkBaseSkeleton.module.scss, BpkSkeleton.module.scss, and BpkSkeleton.stories.module.scss - Migrate: surface-highlight, surface-tint, canvas-contrast, surface-contrast, border-radius-sm, border-radius-xs to CSS custom properties with SASS fallbacks - Add themeAttributes.tsx for component-scoped skeleton theme keys - Add themeAttributes-test.tsx with assertions for exported arrays - Update index.ts to export themeAttributes symbols Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
|
Visit https://backpack.github.io/storybook-prs/4952 to see this build running in a browser. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Migrates bpk-component-skeleton styling to use CSS custom properties with SASS fallbacks, and introduces exported theme attribute lists for theming integrations.
Changes:
- Replaced several hard-coded SASS token usages in Skeleton SCSS with
var(--token, sass-fallback)patterns. - Added
themeAttributes.tsx(and tests) to export skeleton theme attribute arrays. - Updated package
index.tsexports to expose the new theme attribute symbols.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/backpack-web/src/bpk-component-skeleton/src/themeAttributes.tsx | Introduces exported theme attribute arrays and a deprecated default export. |
| packages/backpack-web/src/bpk-component-skeleton/src/themeAttributes-test.tsx | Adds Jest coverage asserting the exported arrays’ values. |
| packages/backpack-web/src/bpk-component-skeleton/src/BpkSkeleton.stories.module.scss | Updates story backgrounds to use CSS custom properties with SASS fallbacks. |
| packages/backpack-web/src/bpk-component-skeleton/src/BpkSkeleton.module.scss | Migrates border radii + on-contrast background to CSS custom properties. |
| packages/backpack-web/src/bpk-component-skeleton/src/BpkBaseSkeleton.module.scss | Migrates base background color to CSS custom properties with fallback. |
| packages/backpack-web/src/bpk-component-skeleton/index.ts | Exports new theme attribute symbols via package entrypoint. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export const skeletonThemeAttributes: string[] = []; | ||
|
|
||
| /** | ||
| * Combined deduplicated array of all skeleton private theme attributes. | ||
| * Only exposes component-scoped (private) skeleton tokens — global semantic vars | ||
| * (surface, canvas colours) can be overridden at the theme level independently. | ||
| */ | ||
| export const allSkeletonThemeAttributes: string[] = []; |
There was a problem hiding this comment.
Outdated — this comment refers to a file/section that's no longer part of the current diff (superseded by a later commit on this branch). No action needed here.
| /** | ||
| * @deprecated Use allSkeletonThemeAttributes instead. | ||
| * Will be removed in the next major release. | ||
| */ | ||
| const themeAttributes: string[] = []; | ||
|
|
||
| export default themeAttributes; |
There was a problem hiding this comment.
Outdated — this comment refers to a file/section that's no longer part of the current diff (superseded by a later commit on this branch). No action needed here.
| * limitations under the License. | ||
| */ | ||
|
|
||
| export const skeletonThemeAttributes: string[] = []; |
There was a problem hiding this comment.
Outdated — this comment refers to a file/section that's no longer part of the current diff (superseded by a later commit on this branch). No action needed here.
| * Only exposes component-scoped (private) skeleton tokens — global semantic vars | ||
| * (surface, canvas colours) can be overridden at the theme level independently. | ||
| */ | ||
| export const allSkeletonThemeAttributes: string[] = []; |
There was a problem hiding this comment.
Outdated — this comment refers to a file/section that's no longer part of the current diff (superseded by a later commit on this branch). No action needed here.
| * @deprecated Use allSkeletonThemeAttributes instead. | ||
| * Will be removed in the next major release. | ||
| */ | ||
| const themeAttributes: string[] = []; |
There was a problem hiding this comment.
Outdated — this comment refers to a file/section that's no longer part of the current diff (superseded by a later commit on this branch). No action needed here.
|
Visit https://backpack.github.io/storybook-prs/4952 to see this build running in a browser. |
|
Token value audit — verified every new CSS var introduced in this PR against
All new/old values match — no visual regression risk from this migration. |
Closes #4830
Summary
var(--css-custom-prop, sass-fallback)pattern inBpkBaseSkeleton.module.scss,BpkSkeleton.module.scss, andBpkSkeleton.stories.module.scsssurface-highlight,surface-tint,canvas-contrast,surface-contrast,border-radius-sm,border-radius-xs$bpk-duration-base,$bpk-one-pixel-rem,$bpk-private-skeleton-shimmer-*themeAttributes.tsxexporting component-scoped skeleton theme attribute arraysthemeAttributes-test.tsxwith assertions for all exported arraysindex.tsto export the new themeAttributes symbolsTest plan
BackgroundStyleDefaultandBackgroundStyleOnContraststories show correct colours