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

[CLOV-CSS] Migrate bpk-component-bottom-sheet to CSS custom properties - #4934

Merged
Vincent Liu (xiaogliu) merged 4 commits into
mainfrom
migrate/css-vars-bottom-sheet-4835
Jul 23, 2026
Merged

Vincent Liu (xiaogliu) merged 4 commits into
mainfrom
migrate/css-vars-bottom-sheet-4835

Conversation

@gert-janvercauteren

Copy link
Copy Markdown
Contributor

Closes #4835

Changes

  • Migrates border-radius on the mobile breakpoint to var(--bpk-radius-lg, tokens.$bpk-border-radius-lg) (top-left and top-right corners)
  • Replaces @include utils.bpk-themeable-property(background-color, --bpk-navigation-bar-background-color, ...) on --header-wrapper with var(--bpk-surface-default, tokens.$bpk-surface-default-day)
  • Adds /* gap: */ comments on tokens without CSS var equivalents: z-index, max-width, animation duration/opacity, backdrop colour
  • Removes unused @use imports: borders, typography, utils
  • Adds DarkMode story using BpkDarkExampleWrapper

No themeAttributes.tsx needed (no component-scoped private vars).

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

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 parts of bpk-component-bottom-sheet styling toward CSS custom properties and updates Storybook to include a dark mode example.

Changes:

  • Updated bottom sheet SCSS to use CSS custom properties for mobile border radius and header background color, with “gap” comments for tokens without CSS var equivalents.
  • Removed unused SCSS mixin imports.
  • Added a DarkMode Storybook story using BpkDarkExampleWrapper.

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-bottom-sheet/src/BpkBottomSheet.stories.js Adds a dark mode story and imports the dark wrapper helper.
packages/backpack-web/src/bpk-component-bottom-sheet/src/BpkBottomSheet.module.scss Moves select styles to CSS custom properties and annotates remaining token “gaps”.

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

Comment on lines +41 to +43
transition:
opacity tokens.$bpk-duration-sm ease-in-out,
transform tokens.$bpk-duration-sm ease-in-out;
/* gap: animation duration */ transform tokens.$bpk-duration-sm ease-in-out; /* gap: animation duration */
outline: 0;
background-color: tokens.$bpk-modal-background-color;
opacity: tokens.$bpk-modal-opacity;
background-color: tokens.$bpk-modal-background-color; /* gap: backdrop colour */
- Migrate border-radius on mobile breakpoint to var(--bpk-radius-lg, tokens.$bpk-border-radius-lg)
- Migrate header-wrapper background to var(--bpk-surface-default, tokens.$bpk-surface-default-day), replacing bpk-themeable-property
- Add /* gap: */ comments on tokens without CSS var equivalents: z-index, max-width, animation duration/opacity, backdrop colour
- Remove unused @use imports: borders, typography, utils
- Add DarkMode story using BpkDarkExampleWrapper

Closes #4835

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-surface-default (light #ffffff / dark #131d2b) matches the original $bpk-surface-default-day value exactly, and the var is confirmed to exist in the theme CSS files.
  • --bpk-radius-lg (1.5rem) matches $bpk-border-radius-lg, exists in primitives.css, and is consistent with the existing _radii.scss mixin pattern already used elsewhere in the repo.
  • Design note (not a bug): the component-scoped override hook --bpk-navigation-bar-background-color is replaced by the global semantic var --bpk-surface-default. This means per-instance overriding of just this header background is no longer possible via that hook — but this matches the intended migration pattern (global semantic vars replacing component-private hooks) used across this PR series.

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

Fix indentation and remove stray blank line left over from removing the
/* gap: */ comments — was failing prettier/prettier and
declaration-empty-line-before lint rules in CI.
@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 535a836 into main Jul 23, 2026
15 checks passed
@xiaogliu
Vincent Liu (xiaogliu) deleted the migrate/css-vars-bottom-sheet-4835 branch July 23, 2026 05:32
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-bottom-sheet to CSS custom properties

3 participants