Repository navigation
[CLOV-CSS] Migrate bpk-component-map to CSS custom properties - #4954
Conversation
- Replace bare SASS tokens with CSS var() + SASS fallbacks in all SCSS files - BpkPriceMarkerButton: migrate border-radius, text-on-dark, text-on-light, core-primary, private-map-previous-selection - BpkIconMarkerBackground: migrate core-primary, surface-default (icon color) - DefaultLoadingElement: migrate surface-highlight - Create themeAttributes.tsx with privateMapPreviousSelection and privateMapPoiPin - Create themeAttributes-test.tsx - Add DarkPriceMarkers story using BpkDarkExampleWrapper Closes #4841 Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
|
Visit https://backpack.github.io/storybook-prs/4954 to see this build running in a browser. |
There was a problem hiding this comment.
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-map styling to prefer CSS custom properties (with Sass fallbacks) and adds supporting theme attribute exports plus Storybook coverage for dark mode price markers.
Changes:
- Replaced several hard-coded day tokens in SCSS with
var(--bpk-…, tokens.$…-day)fallbacks. - Added
themeAttributesexport + test for private map theming attributes. - Added a dark-mode Storybook story for price markers.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/backpack-web/src/bpk-component-map/src/themeAttributes.tsx | Introduces exported list of private map theme attributes. |
| packages/backpack-web/src/bpk-component-map/src/themeAttributes-test.tsx | Adds a unit test asserting the theme attribute list. |
| packages/backpack-web/src/bpk-component-map/src/DefaultLoadingElement.module.scss | Uses CSS custom property fallback for surface-highlight background. |
| packages/backpack-web/src/bpk-component-map/src/BpkPriceMarkerButton.module.scss | Migrates price marker button colors and radius to CSS custom properties. |
| packages/backpack-web/src/bpk-component-map/src/BpkMap.stories.js | Adds dark-mode price marker Storybook story. |
| packages/backpack-web/src/bpk-component-map/src/BpkIconMarkerBackground.module.scss | Uses CSS custom property fallback for selected marker fill. |
| packages/backpack-web/src/bpk-component-map/src/BpkIconMarker.module.scss | Uses CSS custom property fallback for icon color. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| justify-content: center; | ||
| align-items: center; | ||
| border-radius: tokens.$bpk-border-radius-sm; | ||
| border-radius: var(--bpk-radius-sm, tokens.$bpk-border-radius-sm); |
There was a problem hiding this comment.
Not a problem — --bpk-radius-sm is the correct, actual existing CSS var name in this codebase (confirmed present in token-sync/css/primitives.css, value 0.5rem, matching $bpk-border-radius-sm). It's not a 1:1 rename of the SASS token name — the CSS var system uses shorter semantic names by design, and --bpk-radius-sm is the same convention already used repo-wide (e.g. the _radii.scss mixin: border-radius: var(--bpk-radius-sm, tokens.$bpk-border-radius-sm);). No change needed.
| const mapThemeAttributes: string[] = [ | ||
| 'privateMapPreviousSelection', | ||
| 'privateMapPoiPin', | ||
| ]; | ||
|
|
||
| export default mapThemeAttributes; |
There was a problem hiding this comment.
Outdated — themeAttributes.tsx is no longer part of this PR's current diff (superseded by a later commit on this branch). No action needed.
| const mapThemeAttributes: string[] = [ | ||
| 'privateMapPreviousSelection', | ||
| 'privateMapPoiPin', | ||
| ]; |
There was a problem hiding this comment.
Outdated — themeAttributes.tsx is no longer part of this PR's current diff (superseded by a later commit on this branch). No action needed.
|
Visit https://backpack.github.io/storybook-prs/4954 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4954 to see this build running in a browser. |
|
Token value audit — verified every new CSS var introduced in this PR against
All new/old values match — no visual regression risk from this migration. |
Summary
bpk-component-mapSCSS files to use CSS custom properties with SASS fallbackstokens.$bpk-*-dayvalues withvar(--bpk-*, tokens.$bpk-*-day)patternborder-radius,text-on-dark,text-on-light,core-primary, andprivate-map-previous-selectiontokenscore-primaryfor selected fill and strokesurface-defaultfor icon colorsurface-highlightfor backgroundthemeAttributes.tsxexposingprivateMapPreviousSelectionandprivateMapPoiPinprivate map varsthemeAttributes-test.tsxwith coverage for the new TypeScript theme attributesDarkPriceMarkersstory usingBpkDarkExampleWrapperfor dark mode visual coverageCloses #4841
🤖 Generated with Claude Code