[CLOV-CSS] Migrate bpk-component-checkbox to CSS custom properties - #4946
Conversation
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-checkbox styling from SCSS tokens to CSS custom properties, adds a consolidated theme attributes export, and introduces dark-mode visual test stories.
Changes:
- Added
allCheckboxThemeAttributes(private checkbox CSS var keys) while keeping legacycheckboxCheckedColoras deprecated default. - Updated checkbox SCSS to use CSS custom properties with token fallbacks and added a dark-mode visual test story.
- Updated horizontal-nav SCSS/stories to use CSS custom properties and added a dark-mode visual test story.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/backpack-web/src/bpk-component-horizontal-nav/src/BpkHorizontalNavItem.module.scss | Replaces themeable-property mixins with direct var(--...) usage for colors/underline styling. |
| packages/backpack-web/src/bpk-component-horizontal-nav/src/BpkHorizontalNav.stories.module.scss | Uses semantic CSS var with token fallback for custom story color. |
| packages/backpack-web/src/bpk-component-horizontal-nav/src/BpkHorizontalNav.stories.js | Adds a dark-mode visual test story. |
| packages/backpack-web/src/bpk-component-horizontal-nav/src/BpkHorizontalNav.module.scss | Uses CSS var fallback for underline border color. |
| packages/backpack-web/src/bpk-component-checkbox/src/themeAttributes.ts | Introduces allCheckboxThemeAttributes and keeps legacy default export as deprecated. |
| packages/backpack-web/src/bpk-component-checkbox/src/themeAttributes-test.ts | Adds tests for both deprecated default export and new allCheckboxThemeAttributes. |
| packages/backpack-web/src/bpk-component-checkbox/src/BpkCheckbox.stories.tsx | Adds a dark-mode visual test story. |
| packages/backpack-web/src/bpk-component-checkbox/src/BpkCheckbox.module.scss | Migrates checkbox styling to CSS custom properties and introduces new private checkbox vars usage. |
| packages/backpack-web/src/bpk-component-checkbox/index.ts | Re-exports allCheckboxThemeAttributes alongside existing themeAttributes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Replaces static SASS tokens in BpkCheckbox.module.scss with CSS custom properties so the component participates in the Backpack light/dark theme system. Updates themeAttributes to export allCheckboxThemeAttributes with all private component-scoped vars, adds VisualTestDarkMode story. Closes #4815 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
5d679a2 to
e7fe027
Compare
|
Visit https://backpack.github.io/storybook-prs/4946 to see this build running in a browser. |
The duplicated :checked/:indeterminate and :disabled blocks in BpkCheckbox.module.scss shadowed the mixin's own rules. Move the CSS var declarations into bpk-checkbox__input so there is a single source of truth and no specificity conflicts. The pre-@include border-color was also clobbered by the mixin's border shorthand, so that is now set inside the mixin directly. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
Visit https://backpack.github.io/storybook-prs/4946 to see this build running in a browser. |
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Adjusted height and border-radius for indeterminate checkbox state. Reintroduced disabled cursor style for checkbox input.
|
Visit https://backpack.github.io/storybook-prs/4946 to see this build running in a browser. |
|
Token value audit — verified every new CSS var against
Everything else checked: values match exactly, no other regression risk. GitHub-wide usage search for the removed theming hook ( Searched github.com (via Results — no real consumer usage found. Hits are limited to:
No product repo anywhere in the org uses Conclusion: safe to merge. |
Closes #4815
Migrates bpk-component-checkbox SCSS to CSS custom properties and creates themeAttributes with allCheckboxThemeAttributes.