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

[CLOV-CSS] Migrate bpk-component-flare to CSS custom properties - #4929

Merged
Vincent Liu (xiaogliu) merged 6 commits into
mainfrom
migrate/css-vars-flare-4839
Jul 23, 2026
Merged

Vincent Liu (xiaogliu) merged 6 commits into
mainfrom
migrate/css-vars-flare-4839

Conversation

@gert-janvercauteren

Copy link
Copy Markdown
Contributor

Closes #4839

Changes

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

SCSS migrations

bpk-content-bubble.module.scss

  • fill: tokens.$bpk-surface-default-day → fill: var(--bpk-surface-default, tokens.$bpk-surface-default-day)
  • Flare-specific dimension tokens ($bpk-flare-corner-radius, $bpk-flare-height-desktop, $bpk-flare-height-mobile) annotated with /* gap: flare-specific dimension */ comments

bpk-flare-bar.module.scss

  • fill: tokens.$bpk-surface-default-day → fill: var(--bpk-surface-default, tokens.$bpk-surface-default-day)
  • Flare-specific dimension tokens annotated with gap comments

BpkFlare.stories.module.scss

  • background-color: tokens.$bpk-core-primary-day → var(--bpk-core-primary, tokens.$bpk-core-primary-day)
  • fill: tokens.$bpk-core-primary-day → var(--bpk-core-primary, tokens.$bpk-core-primary-day)
  • background-color: tokens.$bpk-core-accent-day → var(--bpk-core-accent, tokens.$bpk-core-accent-day)
  • color: tokens.$bpk-text-primary-inverse-day → var(--bpk-text-inverse, tokens.$bpk-text-primary-inverse-day)

Stories

Added BpkContentBubbleDarkMode story using BpkDarkExampleWrapper to demonstrate dark mode rendering.

No themeAttributes changes

No themeAttributes.tsx file exists for this component — flare has no per-instance theme override API.

Copilot AI review requested due to automatic review settings July 22, 2026 07:55

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-flare styling toward CSS custom properties (with Sass token fallbacks) and adds a Storybook example to demonstrate dark mode rendering.

Changes:

  • Updated flare SCSS modules to use CSS custom properties for color tokens while annotating flare-specific dimension tokens.
  • Updated Storybook styles to use CSS custom properties for palette/text tokens.
  • Added a dark mode Storybook story using BpkDarkExampleWrapper.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/backpack-web/src/bpk-component-flare/src/bpk-flare-bar.module.scss Adds CSS custom property for surface fill; annotates flare dimension tokens.
packages/backpack-web/src/bpk-component-flare/src/bpk-content-bubble.module.scss Adds CSS custom property for surface fill; annotates flare dimension tokens and normalizes formatting.
packages/backpack-web/src/bpk-component-flare/src/BpkFlare.stories.tsx Adds BpkContentBubbleDarkMode story wrapped in BpkDarkExampleWrapper.
packages/backpack-web/src/bpk-component-flare/src/BpkFlare.stories.module.scss Migrates story colors to CSS custom properties with Sass fallbacks.

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

max-width: 45rem;
margin: tokens.bpk-spacing-xl();
color: tokens.$bpk-text-primary-inverse-day;
color: var(--bpk-text-inverse, tokens.$bpk-text-primary-inverse-day);
Comment on lines +159 to +163
<BpkContentBubble
className={getClassName('bpk-flare-stories__content-bubble')}
rounded
flareProps={{svgClassName: getClassName('bpk-flare-stories__flare-bar--svg')}}
content={contentShort}
@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

- Replace static SASS tokens with CSS var() + SASS fallbacks in SCSS modules
- bpk-content-bubble: fill uses --bpk-surface-default
- bpk-flare-bar: fill uses --bpk-surface-default
- stories module: background-color uses --bpk-core-primary / --bpk-core-accent, color uses --bpk-text-inverse
- Flare-specific dimension tokens annotated with gap comments
- Add BpkContentBubbleDarkMode story using BpkDarkExampleWrapper

Closes #4839

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

Copy link
Copy Markdown
Contributor

@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.

Reviewed ✅ — no issues found.

  • --bpk-core-primary (container background + flare-bar svg fill) updated together — paired correctly.
  • --bpk-core-accent (content-bubble background) + --bpk-text-inverse (corresponding text colour) updated together — no missed sibling changes.
  • --bpk-surface-default (rounded-corner fill) confirmed.
  • All new vars are confirmed to exist in the theme CSS files with values matching the original SASS tokens.
  • Nice catch: the stylelint-disable-next-line comments were correctly converted to disable/enable block pairs, since the reformatted multi-line calc() would no longer be covered by a single-line disable.

Verified new token values against token-sync/css/theme-backpack-light.css / theme-backpack-dark.css / primitives.css.

@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 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 a96a749 into main Jul 23, 2026
20 of 21 checks passed
@xiaogliu
Vincent Liu (xiaogliu) deleted the migrate/css-vars-flare-4839 branch July 23, 2026 05:34
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-flare to CSS custom properties

3 participants