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

[CLOV-CSS] Migrate bpk-component-chat-notification to CSS custom properties - #4938

Merged
Vincent Liu (xiaogliu) merged 2 commits into
mainfrom
migrate/css-vars-chat-notification-4824
Jul 23, 2026
Merged

Vincent Liu (xiaogliu) merged 2 commits into
mainfrom
migrate/css-vars-chat-notification-4824

Conversation

@gert-janvercauteren

Copy link
Copy Markdown
Contributor

Closes #4824

Changes

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

Token migrations

Property Before After
border-radius tokens.$bpk-border-radius-md var(--bpk-radius-md, tokens.$bpk-border-radius-md)
background tokens.$bpk-core-primary-day var(--bpk-core-primary, tokens.$bpk-core-primary-day)
color tokens.$bpk-text-on-dark-day var(--bpk-text-on-dark, tokens.$bpk-text-on-dark-day)
fill tokens.$bpk-text-on-dark-day var(--bpk-text-on-dark, tokens.$bpk-text-on-dark-day)
padding tokens.bpk-spacing-base() var(--bpk-spacing-base, tokens.bpk-spacing-base())
gap tokens.bpk-spacing-md() var(--bpk-spacing-md, tokens.bpk-spacing-md())

Stories

Added VisualTestDarkMode story using BpkDarkExampleWrapper.

Test plan

  • All existing tests pass (9 tests passed)
  • SCSS formatted with prettier
  • Dark mode story added

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

Copy link
Copy Markdown
Contributor

…erties

Migrates border-radius, background, color, fill, padding and gap to
CSS custom properties with SASS token fallbacks. Adds VisualTestDarkMode
story using BpkDarkExampleWrapper.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
@gert-janvercauteren
Gert-Jan Vercauteren (gert-janvercauteren) force-pushed the migrate/css-vars-chat-notification-4824 branch from 2bb79d2 to 9378d11 Compare July 22, 2026 08:31

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-chat-notification styling to CSS custom properties (with Sass token fallbacks) and adds a Storybook visual test to validate dark mode rendering.

Changes:

  • Switched SCSS tokens to var(--token, sass-fallback) for radius, colors, spacing, and icon fill.
  • Added a VisualTestDarkMode Storybook story using BpkDarkExampleWrapper.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/backpack-web/src/bpk-component-chat-notification/src/BpkChatNotification.stories.tsx Adds a dark-mode visual test story via BpkDarkExampleWrapper.
packages/backpack-web/src/bpk-component-chat-notification/src/BpkChatNotification.module.scss Replaces Sass tokens with CSS custom properties (with Sass fallbacks) for theming support.

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

Comment on lines +21 to +22
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.

@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-spacing-base $bpk-spacing-base 1rem (no dark override — rem/radius values are theme-agnostic) ✅
--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-spacing-md $bpk-spacing-md 0.5rem (no dark override — rem/radius values are theme-agnostic) ✅

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 21b6088 into main Jul 23, 2026
15 checks passed
@xiaogliu
Vincent Liu (xiaogliu) deleted the migrate/css-vars-chat-notification-4824 branch July 23, 2026 08:57
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-chat-notification to CSS custom properties

3 participants