Repository navigation
[CLOV-CSS] Migrate bpk-component-popover to CSS custom properties - #4949
Conversation
Closes #4844 Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
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-popover styling to CSS custom properties (with SASS fallbacks) and adds a dark-mode visual regression story to validate the new theming behavior.
Changes:
- Updated popover SCSS tokens to
var(--bpk-*, fallback)patterns for surfaces and spacing. - Added a
VisualTestDarkStorybook story usingBpkDarkExampleWrapper.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/backpack-web/src/bpk-component-popover/src/BpkPopover.stories.js | Adds a dark-mode visual test story wrapped in BpkDarkExampleWrapper. |
| packages/backpack-web/src/bpk-component-popover/src/BpkPopover.module.scss | Replaces hard-coded surface/spacing tokens with CSS custom properties + SASS fallbacks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const DarkExample = () => ( | ||
| <BpkDarkExampleWrapper> | ||
| <Spacer> | ||
| <PopoverContainer id="my-popover-dark" isOpen /> | ||
| </Spacer> | ||
| </BpkDarkExampleWrapper> | ||
| ); |
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.
| const DarkExample = () => ( | ||
| <BpkDarkExampleWrapper> | ||
| <Spacer> | ||
| <PopoverContainer id="my-popover-dark" isOpen /> |
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.
| transition: opacity tokens.$bpk-duration-sm ease-in-out; | ||
| outline: 0; | ||
| background-color: tokens.$bpk-color-white; | ||
| background-color: var(--bpk-surface-default, tokens.$bpk-color-white); |
There was a problem hiding this comment.
Not a bug — $bpk-color-white and $bpk-surface-default-day are both rgb(255,255,255) (#ffffff), so the fallback resolves to the identical colour either way. The fallback only kicks in when var() support is absent, so functionally there's no difference. Agree $bpk-surface-default-day would be the more semantically precise fallback to use going forward, but this isn't a rendering bug.
|
Visit https://backpack.github.io/storybook-prs/4949 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. |
Summary
bpk-component-popoverSCSS to use CSS custom properties with SASS fallbackstokens.$bpk-color-whiteandtokens.$bpk-surface-default-daywithvar(--bpk-surface-default, ...)patternbpk-spacing-base,bpk-spacing-md) withvar(--bpk-spacing-*, ...)equivalentsVisualTestDark) usingBpkDarkExampleWrapper$bpk-duration-sm,$bpk-duration-xs,$bpk-breakpoint-mobile,$bpk-one-pixel-rem) left as bare SASS tokens — no CSS var equivalent existsthemeAttributes.tsxunchanged — correctly delegates tobpk-component-linktheme attributesCloses #4844
🤖 Generated with Claude Code