Repository navigation
fix(theme): align the checkbox recipes with Open Components - #375
Merged
alexgrozav merged 2 commits intoOct 29, 2026
Merged
Conversation
The checkbox and checkbox-field recipes now meet the stylesheet rules of the Open Components Checkbox page. The focus ring uses color.focus, and the unchecked border moves to gray-450 and gray-500, so it has 3:1 against the page in both themes. The box is sized in rem, the wrapper draws a 1.5rem hit area around it and pads each label to that height, and a wrapping label keeps the box beside its first line in either direction. Read-only and invalid come from aria-readonly and aria-invalid, never :read-only or :invalid. More contrast draws the border at full strength, and forced colors mode marks checked, focus and disabled with system colours. A disabled box inside the wrapper no longer dims twice.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Assert every forced-colors block of the checkbox field exactly, the neutral dark re-assertions included, and pin the checked and indeterminate marks to their own paths, so swapping a mark or dropping a re-assertion fails. Assert each size's hit-area position. Re-assert the invalid border on checked and indeterminate boxes instead of relying on emission order, take the dashed read-only border from the border-style token, and match the double-dim reset to the label's descendant selector. The docs show the alignment the recipe emits and say which states need wiring.
7 of 13 tasks
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Brings
useCheckboxRecipeanduseCheckboxFieldRecipein line with the stylesheet rules of the Open Components Checkbox page, so a checkbox built on them is easy to see, press and read in every state and setting.@color.gray-450on light surfaces and@color.gray-500on dark ones (wasgray-300andgray-600, about 1.5:1), so it has 3:1 against the page in both themes.checkboxContrast.test.tschecks the border, fill, mark, invalid border, label and focus ring for every color in both themes.@color.focus, 2px outside the box.rem(same values at 16px). The wrapper draws a1.5remhit area around the box with&:before, placed withinset-inline-start, and pads each label to that height. The box sits beside the label's first line, so a long label wraps beside it, in either direction.[aria-readonly="true"](dashed border, default cursor) and invalid from[aria-invalid="true"](@color.errorborder plus a second inset pixel), never from:read-onlyor:invalid. No state changes the box's size.contrast-moredraws the border at full strength. In forced colors mode a checked box is filled withHighlight, its mark gets a dark outline so it shows on any highlight colour, the ring isHighlight, and disabled showsGrayTextinstead of an opacity.Storybook gains read-only, invalid, focus and long-label stories, and the docs page's Accessibility section describes all of the above. No variant name, value, default or export changes.
Related issue
None.
Type of change
Checklist
feat(theme): …)pnpm build:nodocs && pnpm lint && pnpm typecheck && pnpm testand everything passes (all pass except 8@styleframe/playgroundtests intest/theme.test.ts, which fail the same way on the base branch:localStorageis undefined under the local Node version)pnpm changeset) for changes to publishable packages, or this change only touches docs/storybook/app/playground/testsdist/,.styleframe/)mainand stays focused in scope (it targets thealign-component-styles-uxf-487integration branch, and stays focused in scope)Notes / screenshots
Two recommended looks from the page are met differently, without breaking a rule:
@color.primaryfill and white mark inside a dashed border, rather than dropping the fill and drawing the check in the text colour. The mark is a white SVG background image, so a text-coloured check would need a second hardcoded colour per theme. The dashed border tells it apart, in forced colors mode too.checkbox/hover-capableas it stands.The label's height comes from
padding-block: max(0px, …)rather thanmin-height, so the label's first line and the box share one 1.5rem band at every size.