Repository navigation
[CLOV-CSS] Migrate bpk-component-tooltip to CSS custom properties - #4933
Conversation
Replaces bare SASS tokens with var() + SASS fallback pattern: - $bpk-surface-contrast-day → var(--bpk-surface-contrast, ...) - $bpk-surface-default-day → var(--bpk-surface-default, ...) - $bpk-text-primary-inverse-day → var(--bpk-text-inverse, ...) Gap tokens annotated with comments (z-index, animation duration). Adds VisualTestDark story using BpkDarkExampleWrapper. Closes #4813 Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
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-tooltip styles to use CSS custom properties (with SASS token fallbacks) and adds a Storybook story to visually validate dark-mode theming.
Changes:
- Replace several tooltip SCSS token usages with CSS custom properties + SASS fallbacks.
- Annotate remaining “gap” tokens that have no CSS var equivalent.
- Add a new
VisualTestDarkStorybook story wrapped inBpkDarkExampleWrapper.
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-tooltip/src/BpkTooltip.stories.tsx | Adds a dark-mode visual regression story using BpkDarkExampleWrapper. |
| packages/backpack-web/src/bpk-component-tooltip/src/BpkTooltip.module.scss | Switches selected tooltip colors to CSS custom properties with SASS fallbacks and annotates gaps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <BpkTooltip | ||
| ariaLabel="Montréal-Trudeau International Airport" | ||
| id="my-tooltip-dark" | ||
| type={TOOLTIP_TYPES.dark} | ||
| target={ |
There was a problem hiding this comment.
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.
| const VisualTestDarkExample = () => ( | ||
| <BpkDarkExampleWrapper> | ||
| <div style={wrapperStyle}> | ||
| <BpkTooltip | ||
| ariaLabel="Montréal-Trudeau International Airport" | ||
| id="my-tooltip-dark" | ||
| type={TOOLTIP_TYPES.dark} | ||
| target={ | ||
| <div> | ||
| <Heading>YUL</Heading> | ||
| </div> | ||
| } | ||
| isOpen | ||
| > | ||
| Montréal-Trudeau International Airport | ||
| </BpkTooltip> | ||
| </div> | ||
| </BpkDarkExampleWrapper> | ||
| ); |
There was a problem hiding this comment.
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.
|
Visit https://backpack.github.io/storybook-prs/4933 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. |
Closes #4813
Changes
Migrates
bpk-component-tooltipSCSS to use CSS custom properties with SASS token fallbacks, enabling light/dark mode theming via the CSS var system.Token migrations
tokens.$bpk-surface-contrast-dayvar(--bpk-surface-contrast, ...)tokens.$bpk-surface-default-dayvar(--bpk-surface-default, ...)tokens.$bpk-text-primary-inverse-dayvar(--bpk-text-inverse, ...)Gap tokens (annotated, no CSS var equivalent)
tokens.$bpk-zindex-tooltip—/* gap: z-index, not in token-sync */tokens.$bpk-duration-sm—/* gap: animation duration */Story additions
VisualTestDarkstory usingBpkDarkExampleWrapperto verify dark mode renderingNo
themeAttributes.tsxchanges required.Co-Authored-By: Claude Sonnet 4.6 (1M context) [email protected]