Skip to content

IBX-12418: Centred choice input rows on the checkbox, not its wrapper - #142

Open
tischsoic wants to merge 2 commits into
mainfrom
IBX-12418-choice-input-wrapper-centring
Open

IBX-12418: Centred choice input rows on the checkbox, not its wrapper#142
tischsoic wants to merge 2 commits into
mainfrom
IBX-12418-choice-input-wrapper-centring

Conversation

@tischsoic

@tischsoic tischsoic commented Sep 3, 2026

Copy link
Copy Markdown
Contributor
🎫 Issue IBX-12418

Related PRs:

Description:

.ids-choice-input-field__input-wrapper is a block box inheriting the 21px line height, so a 16px inline checkbox sits in a 21.5px line box with its centre 2.75px below the wrapper's. align-items: center on the row centres that wrapper rather than the control, leaving every CheckboxField / RadioButtonField label off-centre. Making the wrapper a flex box shrinks it to the control.

Second commit: with the wrapper hugging the control, Chrome's UA margins on the inputs become visible — checkbox 3px 3px 3px 4px (symmetric, harmless), radio 3px 3px 0 5px (1.5px off). The back office never showed it because Bootstrap's reboot zeroes input margins; the design system shouldn't rely on that, so choice-input-base now resets margin: 0. No change in the back office.

Needs #136 as well — it removes the 9px bottom margin on .ids-choice-input-label, which offsets the row the other way. Label centre − input centre, measured:

checkbox radio
IBX-12418 trash modal, back office, today −1.75px
Storybook Checked story, main + #136 +3.0px +1.5px
Storybook Checked story, main + #136 + this PR 0.00px 0.00px

For QA:

Storybook CheckboxField / RadioButtonField Checked stories, or Content structure → ⋮ → Send to trash: the label text must be vertically centred against the box, and the box flush with the row's left edge.

Documentation:

tischsoic and others added 2 commits September 3, 2026 17:46
`.ids-choice-input-field__input-wrapper` is a block box inheriting the
21px line height, so the 16px inline checkbox sat in a 21.5px line box and
its centre fell 2.75px below the wrapper's. `align-items: center` on the
row centres that wrapper, not the control, so every CheckboxField and
RadioButtonField label sat off-centre against its input. Making the
wrapper a flex box shrinks it to the control.

Co-Authored-By: Claude <noreply@anthropic.com>
Chrome's UA stylesheet gives checkboxes `margin: 3px 3px 3px 4px` and
radios `margin: 3px 3px 0 5px`; with the wrapper now hugging the control,
the radio's asymmetric margin put its centre 1.5px off the label's. The
back office never showed this because Bootstrap's reboot zeroes input
margins; the design system should not depend on that.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants