Repository navigation
[CLOV-CSS] Migrate bpk-component-label to CSS custom properties - #4921
Conversation
|
Visit https://backpack.github.io/storybook-prs/4921 to see this build running in a browser. |
- Replace bare `tokens.$bpk-text-disabled-on-dark-day` with `var(--bpk-text-disabled-on-dark, tokens.$bpk-text-disabled-on-dark-day)` - Remove `bpk-themeable-property` mixin call for `$bpk-form-validation-color` (no CSS var exists yet); add gap comment and keep bare SASS token - Remove unused `@use utils` import - Add `DarkMode` story showing white/disabled/invalid label variants on dark bg Closes #4846 Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
b2ef997 to
7315aec
Compare
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.
Updates several Backpack Web components to better support dark mode by introducing CSS custom property fallbacks (and adding dark-mode Storybook examples), while keeping a few SASS token “gaps” where no semantic CSS vars exist yet.
Changes:
- Add dark-mode Storybook stories/wrappers for Overlay, Label, and Floating Notification.
- Replace several hard-coded “day” color usages with CSS custom properties + SASS fallbacks.
- Adjust SCSS for overlays/notifications (notably switching from
rgba()tocolor-mix()for CSS-var compatibility).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/backpack-web/src/bpk-component-overlay/src/BpkOverlay.stories.tsx | Adds a dark-mode Storybook example wrapper around MixedExample. |
| packages/backpack-web/src/bpk-component-overlay/src/BpkOverlay.module.scss | Migrates overlay opacity colors to color-mix() with CSS var fallbacks. |
| packages/backpack-web/src/bpk-component-label/src/BpkLabel.stories.tsx | Adds a dark-mode story showcasing white/invalid/disabled label states. |
| packages/backpack-web/src/bpk-component-label/src/BpkLabel.module.scss | Uses CSS custom properties for disabled-on-dark label color; changes asterisk styling. |
| packages/backpack-web/src/bpk-component-floating-notification/src/BpkFloatingNotification.stories.tsx | Adds dark-mode stories and a dark-mode-compatible tag. |
| packages/backpack-web/src/bpk-component-floating-notification/src/BpkFloatingNotification.module.scss | Switches to CSS var fallbacks for key colors/radius and adjusts critical variant tokens. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Visit https://backpack.github.io/storybook-prs/4921 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4921 to see this build running in a browser. |
This comment was marked as duplicate.
This comment was marked as duplicate.
|
GitHub-wide usage search for the removed theming hook ( Searched github.com (via Results — no real consumer usage found. Hits are limited to:
No product repo anywhere in the org overrides Conclusion: This is not an issue. Token value audit — verified every new CSS var against
color: tokens.$bpk-form-validation-color;No This looks like a missed migration line, not an intentional gap: color: var(--bpk-status-danger-spot, tokens.$bpk-form-validation-color);(Separately — the hook-removal usage search I posted earlier on this PR still holds: no real consumer uses |
Co-authored-by: Vincent Liu <[email protected]>
|
Visit https://backpack.github.io/storybook-prs/4921 to see this build running in a browser. |
Closes #4846
Migrates
bpk-component-labelSCSS to use CSS custom properties with SASS fallbacks for dark/light mode support.Changes
BpkLabel.module.scss: Replace baretokens.$bpk-text-disabled-on-dark-daywithvar(--bpk-text-disabled-on-dark, tokens.$bpk-text-disabled-on-dark-day)to support automatic dark/light mode theming$bpk-form-validation-color(used for the required asterisk colour) has no CSS var equivalent yet — kept as bare SASS token with a/* gap: ... */commentbpk-themeable-propertymixin call for the asterisk colour (replaced with plain CSS)@use utilsimportBpkLabel.stories.tsx: AddedDarkModestory showing white/disabled/invalid label variants wrapped inBpkDarkExampleWrapper