Repository navigation
[CLOV-CSS] Migrate bpk-component-star-rating to CSS custom properties - #4943
Conversation
|
Visit https://backpack.github.io/storybook-prs/4943 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-star-rating styling from SASS theme hooks to CSS custom properties (with token fallbacks), and adds Storybook coverage for dark mode.
Changes:
- Replaced star colors with CSS custom properties + SASS token fallbacks and improved RTL positioning.
- Removed the component-specific theme attribute hook for filled star color.
- Added dark-mode visual test story for star rating (and additional dark test story elsewhere).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/backpack-web/src/bpk-component-star-rating/src/themeAttributes.ts | Removes exported theme attributes for the component. |
| packages/backpack-web/src/bpk-component-star-rating/src/themeAttributes-test.ts | Updates expectation to match the removed theme attributes. |
| packages/backpack-web/src/bpk-component-star-rating/src/BpkStarRating.stories.tsx | Adds a dark-mode visual test story using the dark wrapper. |
| packages/backpack-web/src/bpk-component-star-rating/src/BpkStar.module.scss | Switches colors to CSS vars + token fallbacks; improves RTL positioning; drops themeable mixin usage. |
| packages/backpack-web/src/bpk-component-star-rating/src/BpkInteractiveStar.module.scss | Adds TODO note and keeps duration token for transitions. |
| packages/backpack-web/src/bpk-component-rating/src/BpkRating.stories.tsx | Removes stray blank lines (formatting-only). |
| packages/backpack-web/src/bpk-component-horizontal-nav/src/BpkHorizontalNav.stories.js | Adds dark-mode visual test story and minor formatting cleanup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| */ | ||
|
|
||
| export default ['starRatingFilledColor']; | ||
| 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 BpkInteractiveStar.module.scss and BpkStar.module.scss now). No action needed.
| export const VisualTestDark = { | ||
| render: () => <DarkExample />, | ||
| }; |
There was a problem hiding this comment.
Outdated — BpkStarRating.stories.tsx is no longer part of this PR's current diff. No action needed.
|
Visit https://backpack.github.io/storybook-prs/4943 to see this build running in a browser. |
d801e54 to
07150f6
Compare
- Replace bpk-themeable-property mixin with plain var() for filled star fill color - Migrate $bpk-status-warning-spot-day -> var(--bpk-status-warning-spot, ...) - Migrate $bpk-text-disabled-day -> var(--bpk-text-disabled, ...) - Replace physical left:0 with logical inset-inline-start:0 for RTL support - Remove @use utils import from BpkStar.module.scss (no longer needed) - Add TODO comments for gap tokens: $bpk-icon-size-sm/lg/xxxl, $bpk-duration-sm - Clear themeAttributes (old --bpk-star-rating-filled-color hook superseded) - Add VisualTestDark story using BpkDarkExampleWrapper Closes #4832 Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
07150f6 to
fe404e9
Compare
|
Visit https://backpack.github.io/storybook-prs/4943 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4943 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 #4832
Changes
Migrates
bpk-component-star-ratingSCSS to CSS custom properties with SASS token fallbacks for light/dark mode support.BpkStar.module.scss
$bpk-status-warning-spot-day→var(--bpk-status-warning-spot, tokens.$bpk-status-warning-spot-day)(filled star colour)$bpk-text-disabled-day→var(--bpk-text-disabled, tokens.$bpk-text-disabled-day)(empty star colour)left: 0with logicalinset-inline-start: 0(RTL support)@use utilsimport (no longer needed after dropping bpk-themeable-property)$bpk-icon-size-sm/lg/xxxlBpkInteractiveStar.module.scss
$bpk-duration-sm(no CSS custom property equivalent yet)themeAttributes.ts / themeAttributes-test.ts
starRatingFilledColortheme attribute — the old--bpk-star-rating-filled-colorhook is superseded by the global--bpk-status-warning-spotCSS varBpkStarRating.stories.tsx
VisualTestDarkstory usingBpkDarkExampleWrapper