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

[CLOV-CSS] Migrate bpk-component-collapsible to CSS custom properties - #4953

Merged
Vincent Liu (xiaogliu) merged 4 commits into
mainfrom
migrate/css-vars-collapsible-4809
Jul 24, 2026
Merged

Vincent Liu (xiaogliu) merged 4 commits into
mainfrom
migrate/css-vars-collapsible-4809

Conversation

@gert-janvercauteren

Copy link
Copy Markdown
Contributor

Closes #4809

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

Copilot AI review requested due to automatic review settings July 22, 2026 08:49

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.

Migrates bpk-component-collapsible styling to CSS custom properties (with SASS token fallbacks) and adds a Storybook dark mode example to validate light/dark behavior.

Changes:

  • Switched key text colors to var(--token, sass-fallback) patterns for themeability.
  • Added a Storybook “DarkMode” story using a dark example wrapper.

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-collapsible/src/BpkCollapsible.stories.tsx Adds a dark mode Storybook example and imports a dark wrapper utility.
packages/backpack-web/src/bpk-component-collapsible/src/BpkCollapsible.module.scss Replaces hard-coded SASS color tokens with CSS custom properties + SASS fallbacks.

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

Comment on lines +25 to +26
// @ts-expect-error -- bpk-storybook-utils has no type declarations
import { BpkDarkExampleWrapper } from 'bpk-storybook-utils';

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.

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.

Comment on lines 24 to 25
/* gap: animation duration */
$collapsible-duration: tokens.$bpk-duration-sm;

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.

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.

@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-text-primary $bpk-text-primary-day #161616 #ffffff ✅
--bpk-text-on-dark $bpk-text-on-dark-day #ffffff #ffffff ✅
--bpk-text-disabled-on-dark $bpk-text-disabled-on-dark-day rgba(255, 255, 255, 0.5) rgba(255, 255, 255, 0.5) ✅
--bpk-text-disabled $bpk-text-disabled-day rgba(0, 0, 0, 0.2) rgba(255, 255, 255, 0.2) ✅

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 ab50adc into main Jul 24, 2026
15 checks passed
@xiaogliu
Vincent Liu (xiaogliu) deleted the migrate/css-vars-collapsible-4809 branch July 24, 2026 02:23
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-collapsible to CSS custom properties

3 participants