fix: elevate CSS specificity for BS5 radio/checkbox group label margin#1308
Draft
elnelson575 wants to merge 1 commit into
Draft
fix: elevate CSS specificity for BS5 radio/checkbox group label margin#1308elnelson575 wants to merge 1 commit into
elnelson575 wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
4f0136c to
40e324d
Compare
gadenbuie
reviewed
May 13, 2026
Comment on lines
+59
to
+60
| .shiny-input-container.shiny-input-checkboxgroup, | ||
| .shiny-input-container.shiny-input-radiogroup { |
Member
There was a problem hiding this comment.
A trick that I like to use for increasing specificity without changing the rule is to duplicate the class name. It's unusual, but .foo.foo doubles the specificity of .foo. It also serves as a signal that the extra class is included only for specificity reasons, whereas adding an additional class could fail if the classes change and looks like it's included for semantic reasons.
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.
Summary
.shiny-input-radiogroup.shiny-input-radiogroup) — a Garrick-suggested idiom that signals "this is purely for specificity" without changing which elements are matched..shiny-input-radiogroup.shiny-input-container-inline), so inline radio/checkbox groups now use the same calculated label-to-options spacing as their stacked counterparts.inst/css-precompiled/5/bootstrap.min.cssfrom the updated SCSS.selectInput(selectize = FALSE)chevron fix).What changes visually
Stacked (vertical / many-choice) groups are unchanged. Inline groups gain ~2px of breathing room between the group label and the first option so all three variants are consistent.
Computed
margin-topon.shiny-options-group:Before (main)
After (this PR)
Test plan
radioButtons()label spacing is unchangedradioButtons()label spacing now matches verticalcheckboxGroupInput()label spacing is unchangedcheckboxGroupInput()label spacing now matches vertical