Repository navigation
fix(theme): align the radio recipes with the Radio Group standard - #371
Merged
alexgrozav merged 2 commits intoOct 29, 2026
Merged
Conversation
The radio, radio-field and radio-group recipes now meet the stylesheet rules of the Open Components Radio Group page: a @color.focus ring, rings with 3:1 in both modes, rem sizing with the standard's row heights and 44px rows on touch screens, forced-colors and more-contrast handling, and the group's legend, hint, error and aria-invalid state. Stories use a fieldset with a legend and cover the focus, invalid and disabled states, and both docs pages describe the accessibility behaviour.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
useRadioRecipe,useRadioFieldRecipeanduseRadioGroupRecipein line with the stylesheet rules of the Open Components Radio Group page, with one test per rule named after its ID:gray-300/gray-600togray-450/gray-500, so they keep 3:1 against the page and their fill in light and dark mode, thelightanddarkcolours included.radioGroupContrast.test.tschecks every colour in both modes, plus the checked fill, the dot, the invalid ring, the focus ring, and the legend, hint and error text at 4.5:1.@color.focus, 2px solid with a 2px offset, andHighlightin forced colours mode.remand has no margin, and each label row has amin-heightinrem(2rem,2.25rem,2.5rem), with 44px rows under@media (any-pointer: coarse). No state changes a radio's size.<fieldset>and styles its<legend>, adata-slot="hint"and adata-slot="error". The group'saria-invalid="true"turns every ring red, with a 1px inset shadow.:invalidis never used.appearance: auto), so the checked state stays visible, and a disabled label turnsGrayText. Withprefers-contrast: more, the rings use the field's full-strength colour.Stories now wrap groups in a
<fieldset>with a<legend>. They add focus, hint, invalid and disabled stories, and both docs pages get an updated Accessibility section. No recipe, axis, value, default, export, token or modifier is renamed or removed, so this is a patch.Related issue
None.
Type of change
Checklist
feat(theme): …)pnpm build:nodocs && pnpm lint && pnpm typecheck && pnpm testand everything passespnpm changeset) for changes to publishable packages, or this change only touches docs/storybook/app/playground/testsdist/,.styleframe/)mainand stays focused in scopeNotes / screenshots
@styleframe/playground'stest/theme.test.ts: its 8 tests fail withlocalStorageundefined on the base branch as well.main.radio-group/input-heights(a Should): the row heights are the standard's Input heights, which are also the Input layer'smin-heights. In this branch, Styleframe's Input renders at about 31–33px, 39–40px and 46–49px (its font sizes are fluid), so it lines up with a radio atsmonly. Matching that would mean copying the Input's padding and line-box formula into the radio.@color.error-400in dark mode, where@color.errorfalls below 4.5:1. The dark selector is written out in the recipe's setup callback, because setup selectors can't use modifiers.