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

[CLOV-CSS] Migrate bpk-component-content-cards to CSS custom properties - #4942

Merged
Vincent Liu (xiaogliu) merged 2 commits into
mainfrom
migrate/css-vars-content-cards-4825
Jul 23, 2026
Merged

Vincent Liu (xiaogliu) merged 2 commits into
mainfrom
migrate/css-vars-content-cards-4825

Conversation

@gert-janvercauteren

Copy link
Copy Markdown
Contributor

Closes #4825

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

Changes

  • BpkContentCard.module.scss: Migrated two border-radius declarations to var(--bpk-radius-md, tokens.$bpk-border-radius-md) and description text colour to var(--bpk-text-secondary, tokens.$bpk-text-secondary-day). Added a comment explaining tokens.$bpk-one-pixel-rem pixel-precise sizing usage (no CSS var equivalent).
  • BpkContentCards.stories.tsx: Added VisualTestThreeCardsDark story using BpkDarkExampleWrapper for dark mode visual testing.

Copilot AI review requested due to automatic review settings July 22, 2026 08:21
- border-radius: var(--bpk-radius-md, tokens.$bpk-border-radius-md)
- color: var(--bpk-text-secondary, tokens.$bpk-text-secondary-day)
- Added comment for tokens.$bpk-one-pixel-rem usage (no CSS var equivalent)
- Added VisualTestThreeCardsDark story using BpkDarkExampleWrapper

Closes #4825

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

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-content-cards styling toward CSS custom properties (with SASS token fallbacks) and adds a dark-mode Storybook visual test story.

Changes:

  • Updated BpkContentCard SCSS to use CSS custom properties for radius + secondary text color with token fallbacks.
  • Added a dark-mode visual regression story via BpkDarkExampleWrapper.
  • Added an inline comment documenting pixel-precise sizing usage for tokens.$bpk-one-pixel-rem.

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-content-cards/src/BpkContentCards.stories.tsx Adds dark-mode visual test story and updates story content strings.
packages/backpack-web/src/bpk-component-content-cards/src/BpkContentCard.module.scss Switches radius/text color to CSS custom properties with SASS fallbacks; documents sizing token usage.

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

Comment on lines +23 to +24
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.

description:
'Greece gave us the Gyros. A vessel of bread lifting chips from plate to mouth. It doesn\'t get godlier than this.',
"Greece gave us the Gyros. A vessel of bread lifting chips from plate to mouth. It doesn't get godlier than this.",
href: 'https://www.skyscanner.net',

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.

description:
'There are islands for everything. You can party, relax, chill, eat and hike, and that\'s just Santorini.',
"There are islands for everything. You can party, relax, chill, eat and hike, and that's just Santorini.",
href: 'https://www.skyscanner.net',

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-radius-md $bpk-border-radius-md 0.75rem (no dark override — rem/radius values are theme-agnostic) ✅
--bpk-text-secondary $bpk-text-secondary-day #626971 #bdc4cb ✅

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 1e5b9c7 into main Jul 23, 2026
20 of 21 checks passed
@xiaogliu
Vincent Liu (xiaogliu) deleted the migrate/css-vars-content-cards-4825 branch July 23, 2026 08:58
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-content-cards to CSS custom properties

3 participants