[CLOV-CSS] Migrate bpk-component-progress to CSS custom properties - #4930
Conversation
|
Visit https://backpack.github.io/storybook-prs/4930 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-progress styling from SCSS tokens to CSS custom properties (with token fallbacks) and adds dark-mode Storybook coverage.
Changes:
- Switched
bpk-component-progressSCSS from token values /bpk-themeable-propertytovar(--bpk-*, tokenFallback)patterns. - Updated
themeAttributes(and tests) to removeprogressBarFillColor. - Added dark-mode Storybook stories/wrappers and applied similar CSS custom property migrations to inset banner styles.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/backpack-web/src/bpk-component-progress/src/themeAttributes.ts | Removes progressBarFillColor from the themeable attributes list. |
| packages/backpack-web/src/bpk-component-progress/src/themeAttributes-test.ts | Updates expectation for the new (empty) theme attributes export. |
| packages/backpack-web/src/bpk-component-progress/src/BpkProgress.stories.tsx | Adds a dark-mode visual test story using BpkDarkExampleWrapper. |
| packages/backpack-web/src/bpk-component-progress/src/BpkProgress.module.scss | Migrates progress styles to CSS custom properties with token fallbacks. |
| packages/backpack-web/src/bpk-component-inset-banner/src/BpkInsetBannerV3/BpkInsetBannerV3.module.scss | Migrates radii/text colors to CSS custom properties with fallbacks. |
| packages/backpack-web/src/bpk-component-inset-banner/src/BpkInsetBannerV2/BpkInsetBannerSponsored.module.scss | Migrates radii/text colors to CSS custom properties with fallbacks; documents “gap” tokens. |
| packages/backpack-web/src/bpk-component-inset-banner/src/BpkInsetBanner.stories.tsx | Adds a dark-mode example wrapped in BpkDarkExampleWrapper. |
| packages/backpack-web/src/bpk-component-inset-banner/src/BpkInsetBanner.module.scss | Migrates radii/colors to CSS custom properties with fallbacks; documents “gap” tokens. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| */ | ||
|
|
||
| export default ['progressBarFillColor']; | ||
| export default []; |
There was a problem hiding this comment.
Outdated — themeAttributes.ts is no longer part of this PR's current diff (superseded by a later commit, which only touches BpkProgress.module.scss now). No action needed.
| // @ts-expect-error Untyped import. See . | ||
| import { BpkDarkExampleWrapper } from 'bpk-storybook-utils'; |
There was a problem hiding this comment.
Outdated — the stories.tsx file with the ts-expect-error comment is no longer part of this PR's current diff. No action needed.
|
|
||
| .bpk-inset-banner-v3 { | ||
| border-radius: tokens.$bpk-border-radius-sm; | ||
| border-radius: var(--bpk-radius-sm, tokens.$bpk-border-radius-sm); |
There was a problem hiding this comment.
Outdated — the inset-banner files this comment refers to are no longer part of this PR's current diff (scope is now consistent with the title/description, only BpkProgress.module.scss). No action needed.
5bd04b4 to
241e4f6
Compare
Replaces bare SASS tokens with CSS var() declarations backed by SASS fallbacks, enabling light/dark mode theming. Drops the legacy --bpk-progress-bar-fill-color themeable hook in favour of the global --bpk-core-accent semantic var. Removes unused @use of bpk-mixins/utils. Adds VisualTestDark story using BpkDarkExampleWrapper. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
241e4f6 to
24440a3
Compare
|
Visit https://backpack.github.io/storybook-prs/4930 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4930 to see this build running in a browser. |
|
Token value audit — verified every new CSS var against
All new/old values match — no visual regression risk from this migration. |
Closes #4817
What changed
Migrates
bpk-component-progressSCSS to CSS custom properties with SASS token fallbacks for light/dark mode support.Token mappings applied
$bpk-border-radius-md--bpk-radius-mdtokens.$bpk-border-radius-md$bpk-border-radius-sm--bpk-radius-smtokens.$bpk-border-radius-sm$bpk-border-radius-xs--bpk-radius-xstokens.$bpk-border-radius-xs$bpk-canvas-day--bpk-surface-defaulttokens.$bpk-canvas-day$bpk-core-accent-day--bpk-core-accenttokens.$bpk-core-accent-day$bpk-surface-highlight-day--bpk-surface-highlighttokens.$bpk-surface-highlight-day$bpk-duration-base$bpk-one-pixel-remOther changes
@use 'bpk-mixins/utils'import (no longer needed after droppingbpk-themeable-property)bpk-themeable-propertymixin with plainvar()for the fill colourthemeAttributesexport (was['progressBarFillColor']— now empty since--bpk-core-accentis a global semantic var)VisualTestDarkstory usingBpkDarkExampleWrapper