Repository navigation
[CLOV-CSS] Migrate bpk-component-drawer to CSS custom properties - #4920
Conversation
Migrates BpkDrawerContent.module.scss to use CSS custom properties with SASS token fallbacks for surface-default background and border colours. Adds gap comments for animation duration, opacity, and z-index tokens. Adds a DarkMode story using BpkDarkExampleWrapper. Closes #4837 Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
|
Visit https://backpack.github.io/storybook-prs/4920 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 the drawer’s SCSS to CSS custom properties (with SASS fallbacks) to support theming, and adds a Storybook dark mode example.
Changes:
- Updated drawer background and secondary panel border color tokens to use CSS custom properties with SASS fallback values.
- Annotated remaining non-migrated tokens (“gap” tokens) inline in the SCSS.
- Added a
DarkModeStorybook story wrapped inBpkDarkExampleWrapper.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/backpack-web/src/bpk-component-drawer/src/BpkDrawerContent.module.scss | Migrates select tokens to CSS custom properties and annotates non-migrated tokens. |
| packages/backpack-web/src/bpk-component-drawer/src/BpkDrawer.stories.js | Adds a dark mode Storybook example using BpkDarkExampleWrapper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| transition: | ||
| transform tokens.$bpk-duration-base ease, | ||
| width tokens.$bpk-duration-base ease; | ||
| /* gap: animation duration */ width tokens.$bpk-duration-base ease; /* gap: animation duration */ | ||
|
|
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.
| /* gap: animation duration */ transform tokens.$bpk-duration-base | ||
| ease-in-out; /* gap: animation duration */ | ||
|
|
||
| opacity: tokens.$bpk-modal-initial-opacity; /* gap: animation opacity */ |
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.
| &--entered { | ||
| transform: scale(1); | ||
| opacity: tokens.$bpk-modal-opacity; | ||
| opacity: tokens.$bpk-modal-opacity; /* gap: opacity */ |
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.
| &--exited { | ||
| transform: scale(0.9); | ||
| opacity: tokens.$bpk-modal-initial-opacity; | ||
| opacity: tokens.$bpk-modal-initial-opacity; /* gap: animation opacity */ |
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.
|
Visit https://backpack.github.io/storybook-prs/4920 to see this build running in a browser. |
Fix indentation and remove stray blank lines 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/4920 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. |
Closes #4837
Summary
Migrates
BpkDrawerContent.module.scssto use CSS custom properties with SASS token fallbacks, enabling light/dark theme support.Migrated tokens:
tokens.$bpk-surface-default-day→var(--bpk-surface-default, tokens.$bpk-surface-default-day)(drawer background)tokens.$bpk-line-day→var(--bpk-other-line-default, tokens.$bpk-line-day)(secondary panel border)Gap tokens (no CSS var available yet — annotated with comments):
tokens.$bpk-duration-base—/* gap: animation duration */tokens.$bpk-modal-initial-opacity—/* gap: animation opacity */tokens.$bpk-modal-opacity—/* gap: opacity */tokens.$bpk-zindex-drawer—/* gap: z-index */Stories: Added
DarkModestory usingBpkDarkExampleWrapper.No
themeAttributes.tsxchanges needed — the drawer delegates to link theme attributes only.Test plan