Skip to content
This repository was archived by the owner on Aug 5, 2026. It is now read-only.

[CLOV-CSS] Migrate bpk-component-floating-notification to CSS custom properties - #4919

Merged
Vincent Liu (xiaogliu) merged 3 commits into
mainfrom
migrate/css-vars-drawer-4837-clean
Jul 23, 2026
Merged

Vincent Liu (xiaogliu) merged 3 commits into
mainfrom
migrate/css-vars-drawer-4837-clean

Conversation

@gert-janvercauteren

@gert-janvercauteren Gert-Jan Vercauteren (gert-janvercauteren) commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Closes #4840

Changes

Migrates bpk-component-floating-notification SCSS to CSS custom properties with SASS token fallbacks for light/dark mode support.

Token migrations

SASS token CSS custom property
tokens.$bpk-border-radius-md var(--bpk-radius-md, ...)
tokens.$bpk-core-primary-day var(--bpk-core-primary, ...)
tokens.$bpk-text-on-dark-day var(--bpk-text-on-dark, ...)
tokens.$bpk-status-danger-spot-day var(--bpk-status-danger-spot, ...)
tokens.$bpk-text-primary-inverse-day var(--bpk-text-inverse, ...)

Gap tokens (kept as bare SASS — no CSS var equivalent)

  • $bpk-box-shadow-xl / $bpk-box-shadow-lg — box-shadow shorthand
  • $bpk-duration-base — animation duration

No themeAttributes.tsx needed — component has no theme hooks.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 22, 2026 07:41
@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 bpk-component-drawer styling to use CSS custom properties (with SASS fallbacks) and adds a Storybook dark-mode example for the Drawer.

Changes:

  • Migrates Drawer surface/background and divider line color to CSS custom properties with SASS fallbacks.
  • Adds a new DarkMode Storybook story wrapped in BpkDarkExampleWrapper.
  • Adds “gap” comments for tokens that are intentionally kept as SASS-only (e.g., duration).

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-drawer/src/BpkDrawerContent.module.scss Switches some SCSS token usages to CSS custom properties + fallbacks; adds “gap” annotations.
packages/backpack-web/src/bpk-component-drawer/src/BpkDrawer.stories.js Adds a dark mode Drawer story using BpkDarkExampleWrapper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

…properties

Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

@xiaogliu

Copy link
Copy Markdown
Contributor

Token value audit — verified every new CSS var introduced in this PR against token-sync/css/theme-backpack-light.css / theme-backpack-dark.css and the original SASS token source (base.default.scss):

CSS var Old SASS fallback Light value Dark value Match
--bpk-radius-md $bpk-border-radius-md 0.75rem (no dark override — rem/radius values are theme-agnostic) ✅
--bpk-core-primary $bpk-core-primary-day #05203c #054184 ✅
--bpk-text-on-dark $bpk-text-on-dark-day #ffffff #ffffff ✅
--bpk-status-danger-spot $bpk-status-danger-spot-day #e70866 #ff649c ✅
--bpk-text-inverse $bpk-text-primary-inverse-day #ffffff #010913 ✅

All new/old values match — no visual regression risk from this migration.

@xiaogliu Vincent Liu (xiaogliu) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@xiaogliu
Vincent Liu (xiaogliu) merged commit 6982362 into main Jul 23, 2026
20 of 21 checks passed
@xiaogliu
Vincent Liu (xiaogliu) deleted the migrate/css-vars-drawer-4837-clean branch July 23, 2026 08:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate bpk-component-floating-notification to CSS custom properties

3 participants