Skip to content

[CLOV-CSS] Migrate bpk-component-progress to CSS custom properties - #4930

Merged
Vincent Liu (xiaogliu) merged 3 commits into
mainfrom
migrate/css-vars-progress-4817
Jul 24, 2026
Merged

[CLOV-CSS] Migrate bpk-component-progress to CSS custom properties#4930
Vincent Liu (xiaogliu) merged 3 commits into
mainfrom
migrate/css-vars-progress-4817

Conversation

@gert-janvercauteren

Copy link
Copy Markdown
Contributor

Closes #4817

What changed

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

Token mappings applied

Old SASS token New CSS var SASS fallback
$bpk-border-radius-md --bpk-radius-md tokens.$bpk-border-radius-md
$bpk-border-radius-sm --bpk-radius-sm tokens.$bpk-border-radius-sm
$bpk-border-radius-xs --bpk-radius-xs tokens.$bpk-border-radius-xs
$bpk-canvas-day --bpk-surface-default tokens.$bpk-canvas-day
$bpk-core-accent-day --bpk-core-accent tokens.$bpk-core-accent-day
$bpk-surface-highlight-day --bpk-surface-highlight tokens.$bpk-surface-highlight-day
$bpk-duration-base — (gap: animation duration) kept bare
$bpk-one-pixel-rem — (gap: hairline border utility) kept bare

Other changes

  • Removed @use 'bpk-mixins/utils' import (no longer needed after dropping bpk-themeable-property)
  • Replaced bpk-themeable-property mixin with plain var() for the fill colour
  • Cleared themeAttributes export (was ['progressBarFillColor'] — now empty since --bpk-core-accent is a global semantic var)
  • Added VisualTestDark story using BpkDarkExampleWrapper

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

Copy link
Copy Markdown
Contributor

Visit https://backpack.github.io/storybook-prs/4930 to see this build running in a browser.

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-progress styling from SCSS tokens to CSS custom properties (with token fallbacks) and adds dark-mode Storybook coverage.

Changes:

  • Switched bpk-component-progress SCSS from token values / bpk-themeable-property to var(--bpk-*, tokenFallback) patterns.
  • Updated themeAttributes (and tests) to remove progressBarFillColor.
  • Added dark-mode Storybook stories/wrappers and applied similar CSS custom property migrations to inset banner styles.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/backpack-web/src/bpk-component-progress/src/themeAttributes.ts Removes progressBarFillColor from the themeable attributes list.
packages/backpack-web/src/bpk-component-progress/src/themeAttributes-test.ts Updates expectation for the new (empty) theme attributes export.
packages/backpack-web/src/bpk-component-progress/src/BpkProgress.stories.tsx Adds a dark-mode visual test story using BpkDarkExampleWrapper.
packages/backpack-web/src/bpk-component-progress/src/BpkProgress.module.scss Migrates progress styles to CSS custom properties with token fallbacks.
packages/backpack-web/src/bpk-component-inset-banner/src/BpkInsetBannerV3/BpkInsetBannerV3.module.scss Migrates radii/text colors to CSS custom properties with fallbacks.
packages/backpack-web/src/bpk-component-inset-banner/src/BpkInsetBannerV2/BpkInsetBannerSponsored.module.scss Migrates radii/text colors to CSS custom properties with fallbacks; documents “gap” tokens.
packages/backpack-web/src/bpk-component-inset-banner/src/BpkInsetBanner.stories.tsx Adds a dark-mode example wrapped in BpkDarkExampleWrapper.
packages/backpack-web/src/bpk-component-inset-banner/src/BpkInsetBanner.module.scss Migrates radii/colors to CSS custom properties with fallbacks; documents “gap” tokens.

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

*/

export default ['progressBarFillColor'];
export default [];

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 — themeAttributes.ts is no longer part of this PR's current diff (superseded by a later commit, which only touches BpkProgress.module.scss now). No action needed.

Comment on lines +23 to +24
// @ts-expect-error Untyped import. See .
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 — the stories.tsx file with the ts-expect-error comment is no longer part of this PR's current diff. No action needed.


.bpk-inset-banner-v3 {
border-radius: tokens.$bpk-border-radius-sm;
border-radius: var(--bpk-radius-sm, tokens.$bpk-border-radius-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 — the inset-banner files this comment refers to are no longer part of this PR's current diff (scope is now consistent with the title/description, only BpkProgress.module.scss). No action needed.

Replaces bare SASS tokens with CSS var() declarations backed by SASS fallbacks,
enabling light/dark mode theming. Drops the legacy --bpk-progress-bar-fill-color
themeable hook in favour of the global --bpk-core-accent semantic var. Removes
unused @use of bpk-mixins/utils. Adds VisualTestDark story using BpkDarkExampleWrapper.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

Visit https://backpack.github.io/storybook-prs/4930 to see this build running in a browser.

@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

Visit https://backpack.github.io/storybook-prs/4930 to see this build running in a browser.

@xiaogliu

Copy link
Copy Markdown
Contributor

Token value audit — verified every new CSS var against token-sync/css/theme-backpack-light.css / theme-backpack-dark.css, primitives.css, and base.default.scss:

CSS var Old SASS fallback Light value Dark value Match
--bpk-radius-md $bpk-border-radius-md 0.75rem (theme-agnostic)
--bpk-radius-xs $bpk-border-radius-xs 0.25rem (theme-agnostic)
--bpk-radius-sm $bpk-border-radius-sm 0.5rem (theme-agnostic)
--bpk-surface-highlight $bpk-surface-highlight-day #e0e4e9 #243346
--bpk-core-accent $bpk-core-accent-day #0062e3 #84e9ff
--bpk-surface-default $bpk-canvas-day #ffffff #131d2b ✅ ($bpk-canvas-day = rgb(255,255,255) = #ffffff, same value as $bpk-surface-default-day)

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 c3acbf3 into main Jul 24, 2026
15 checks passed
@xiaogliu
Vincent Liu (xiaogliu) deleted the migrate/css-vars-progress-4817 branch July 24, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate bpk-component-progress to CSS custom properties

3 participants