[CLOV-CSS] Migrate bpk-component-modal to CSS custom properties - #4955
Conversation
|
Visit https://backpack.github.io/storybook-prs/4955 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-modal styling to CSS custom properties (with SASS fallbacks) to support light/dark theming, and adds a dark-mode Storybook visual test for Modal V3.
Changes:
- Replaced several SCSS token usages with
var(--css-var, sass-fallback)across modal V2/V3 styles. - Updated modal borders/radii/backgrounds to use themeable CSS custom properties where available.
- Added a
VisualTestDarkStorybook story forBpkModalV3.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/backpack-web/src/bpk-component-modal/src/BpkModalV3/BpkModalV3Scrim/BpkModalV3Scrim.module.scss | Theme scrim background via CSS custom property with SASS fallback. |
| packages/backpack-web/src/bpk-component-modal/src/BpkModalV3/BpkModalV3Content/BpkModalV3Content.module.scss | Theme content surfaces and radii via CSS vars (with fallbacks). |
| packages/backpack-web/src/bpk-component-modal/src/BpkModalV3/BpkModalV3CloseTrigger/BpkModalV3CloseTrigger.module.scss | Theme close trigger colors/radius via CSS vars (with fallbacks). |
| packages/backpack-web/src/bpk-component-modal/src/bpkModalV3/BpkModalV3.stories.tsx | Adds dark-mode visual test story and wrapper import. |
| packages/backpack-web/src/bpk-component-modal/src/BpkModalV2/BpKModal.module.scss | Theme V2 scrim/surface/radius tokens via CSS vars (with fallbacks). |
| packages/backpack-web/src/bpk-component-modal/src/BpkModalInner.module.scss | Theme surface contrast and header border color via CSS vars (with fallbacks). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export const VisualTestDark = { | ||
| render: () => ( | ||
| <BpkDarkExampleWrapper> | ||
| <DefaultExample /> | ||
| </BpkDarkExampleWrapper> | ||
| ), | ||
| }; |
There was a problem hiding this comment.
Outdated — BpkModalV3.stories.tsx is no longer part of this PR's current diff (superseded by a later commit, which only touches the .module.scss files now). No action needed.
| // @ts-expect-error -- bpk-storybook-utils has no type declarations | ||
| import { BpkDarkExampleWrapper } from 'bpk-storybook-utils'; |
There was a problem hiding this comment.
Outdated — same as above, stories.tsx is no longer part of this PR's current diff. No action needed.
| border-radius: var(--bpk-radius-lg, tokens.$bpk-border-radius-lg) | ||
| var(--bpk-radius-lg, tokens.$bpk-border-radius-lg) 0 0; |
There was a problem hiding this comment.
Pre-existing pattern, not introduced by this PR — repeated $bpk-border-radius-lg already existed on main before this migration (top-left/top-right corner radius pair). This PR migrated each occurrence to var() in place; extracting a shared local variable would be a good follow-up but is out of scope for this token-value migration. Separately: see the token-value audit comment I posted on this PR — there's a real fallback-value mismatch on --bpk-other-line-on-contrast in BpkModalV3CloseTrigger.module.scss (50% vs 20% opacity) worth fixing.
|
Visit https://backpack.github.io/storybook-prs/4955 to see this build running in a browser. |
|
Token value audit — verified every new CSS var against
2. Also flagging (not a value bug, a sibling-omission): in Confirmed:
|
Closes #4838
Migrates bpk-component-modal SCSS to CSS custom properties with SASS fallbacks for light/dark mode support.
Changes
var(--css-var, sass-fallback)pattern in 5 SCSS filesVisualTestDark) to BpkModalV3 stories