Repository navigation
[CLOV-CSS] Migrate bpk-component-bottom-sheet to CSS custom properties - #4934
Conversation
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 parts of bpk-component-bottom-sheet styling toward CSS custom properties and updates Storybook to include a dark mode example.
Changes:
- Updated bottom sheet SCSS to use CSS custom properties for mobile border radius and header background color, with “gap” comments for tokens without CSS var equivalents.
- Removed unused SCSS mixin imports.
- Added a DarkMode Storybook story using
BpkDarkExampleWrapper.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/backpack-web/src/bpk-component-bottom-sheet/src/BpkBottomSheet.stories.js | Adds a dark mode story and imports the dark wrapper helper. |
| packages/backpack-web/src/bpk-component-bottom-sheet/src/BpkBottomSheet.module.scss | Moves select styles to CSS custom properties and annotates remaining token “gaps”. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| transition: | ||
| opacity tokens.$bpk-duration-sm ease-in-out, | ||
| transform tokens.$bpk-duration-sm ease-in-out; | ||
| /* gap: animation duration */ transform tokens.$bpk-duration-sm ease-in-out; /* gap: animation duration */ |
| outline: 0; | ||
| background-color: tokens.$bpk-modal-background-color; | ||
| opacity: tokens.$bpk-modal-opacity; | ||
| background-color: tokens.$bpk-modal-background-color; /* gap: backdrop colour */ |
- Migrate border-radius on mobile breakpoint to var(--bpk-radius-lg, tokens.$bpk-border-radius-lg) - Migrate header-wrapper background to var(--bpk-surface-default, tokens.$bpk-surface-default-day), replacing bpk-themeable-property - Add /* gap: */ comments on tokens without CSS var equivalents: z-index, max-width, animation duration/opacity, backdrop colour - Remove unused @use imports: borders, typography, utils - Add DarkMode story using BpkDarkExampleWrapper Closes #4835 Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
b9ab9e3 to
7d2efa9
Compare
|
Visit https://backpack.github.io/storybook-prs/4934 to see this build running in a browser. |
Vincent Liu (xiaogliu)
left a comment
There was a problem hiding this comment.
Reviewed ✅ — no issues found.
--bpk-surface-default(light#ffffff/ dark#131d2b) matches the original$bpk-surface-default-dayvalue exactly, and the var is confirmed to exist in the theme CSS files.--bpk-radius-lg(1.5rem) matches$bpk-border-radius-lg, exists inprimitives.css, and is consistent with the existing_radii.scssmixin pattern already used elsewhere in the repo.- Design note (not a bug): the component-scoped override hook
--bpk-navigation-bar-background-coloris replaced by the global semantic var--bpk-surface-default. This means per-instance overriding of just this header background is no longer possible via that hook — but this matches the intended migration pattern (global semantic vars replacing component-private hooks) used across this PR series.
Verified new token values against token-sync/css/theme-backpack-light.css / theme-backpack-dark.css / primitives.css.
|
Visit https://backpack.github.io/storybook-prs/4934 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4934 to see this build running in a browser. |
Fix indentation and remove stray blank line left over from removing the /* gap: */ comments — was failing prettier/prettier and declaration-empty-line-before lint rules in CI.
|
Visit https://backpack.github.io/storybook-prs/4934 to see this build running in a browser. |
Closes #4835
Changes
border-radiuson the mobile breakpoint tovar(--bpk-radius-lg, tokens.$bpk-border-radius-lg)(top-left and top-right corners)@include utils.bpk-themeable-property(background-color, --bpk-navigation-bar-background-color, ...)on--header-wrapperwithvar(--bpk-surface-default, tokens.$bpk-surface-default-day)/* gap: */comments on tokens without CSS var equivalents: z-index, max-width, animation duration/opacity, backdrop colour@useimports:borders,typography,utilsDarkModestory usingBpkDarkExampleWrapperNo
themeAttributes.tsxneeded (no component-scoped private vars).