feat(Checkbox): add var7 red color variant to CheckboxMultiSelect#1150
Conversation
🦋 Changeset detectedLatest commit: d57f746 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
crisalbu
left a comment
There was a problem hiding this comment.
For dark mode, we need a lighter colour. ff2323 works well for when it's filled, but it has a low contrast when it's just used for the border.
Could we use the same colour we have for the danger text instead?
Storybook Preview Deployed✅ Preview URL: https://click-4sh6ldkxa-clickhouse.vercel.app Built from commit: |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d57f746. Configure here.

Why?
We needed a red checkbox color option for use inside
CheckboxMultiSelect(andCheckboxdirectly). The component already ships six color variants (var1–var6), but none of them is red, so consumers had no token-backed way to render a red checkbox.This adds a new
var7variant wired to the existing danger palette — the checked fill resolves to#ff2323(=palette.danger.400), the same red already used elsewhere in the design system. The change is purely additive: no existing variant, token, or color is modified, so it is non-breaking.How?
The
variantprop flows straight throughCheckboxMultiSelect.Item→MultiSelectCheckboxItem→Checkbox, soCheckboxMultiSelectitself needed no code change.var7was added at the same four layers every other variant lives in:tokens/themes/dark.json,light.json) — newvar7entry underclick.checkbox.color.variations, modeled onvar1but referencing{palette.danger.*}instead of{palette.success.*}/ chart green. The active fill points at{palette.danger.400}(#ff2323).yarn generate:tokens, which emits--click-checkbox-color-variations-var7-*intotokens-{dark,light}.cssandvariables.{dark,light}.ts. These files are generated, not hand-edited.Checkbox.module.css) — new.checkinput_variant_var7block mapping those tokens onto the component's--checkbox-*CSS custom properties (identical shape tovar1–var6).'var7'added to theCheckboxVariantsunion (Checkbox.types.ts) and to thecvavariant map (Checkbox.tsx).Because
var7reuses existing palette primitives, both light and dark themes are covered:#ff2323, stroke#c10000→#ff7575on hover/active#ff2323, stroke#ff5353Why reuse the danger palette instead of a new color?
#ff2323already exists aspalette.danger.400. Referencing it (rather than hardcoding a hex or introducing a new primitive) keeps the variant in sync with the rest of the danger scale and follows exactly howvar1–var6reference their palette families.Tickets?
N/A
Contribution checklist?
buildcommand runs locallySecurity checklist?
dangerouslySetInnerHTMLPreview?
Verified in Storybook:
Validation run locally (all green):
tsc --noEmit— no type errorseslinton the changed files — cleanvitest run— Checkbox (2) + CheckboxMultiSelect (17) suites passyarn generate:tokens— regenerates cleanly; diff is additive-onlyChanged files
tokens/themes/dark.json,tokens/themes/light.json— newvar7token entry referencing{palette.danger.*}src/theme/styles/tokens-dark.css,src/theme/styles/tokens-light.css— generated--click-checkbox-color-variations-var7-*varssrc/theme/tokens/variables.dark.ts,src/theme/tokens/variables.light.ts— generated TS token entriessrc/components/Checkbox/Checkbox.types.ts—'var7'added toCheckboxVariantssrc/components/Checkbox/Checkbox.tsx—var7added to thecvavariant mapsrc/components/Checkbox/Checkbox.module.css—.checkinput_variant_var7classsrc/components/Checkbox/Checkbox.stories.tsx—Var7Checkedstorysrc/components/CheckboxMultiSelect/CheckboxMultiSelect.stories.tsx— "Variant 7" item in the variants story.changeset/feat-checkbox-var7-variant.md— minor bumpScreenshots
Light Theme
Dark Theme

