fix(Fluent): restore checkbox margins inside input-group - #1108
Conversation
|
Thanks for your PR, @h2ls. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds a Fluent-theme CSS override to restore correct checkbox margins when a Checkbox is rendered inside a Bootstrap input group, ensuring the theme’s standalone checkbox negative-margin rule does not misalign checkboxes in input-group cells, and mirrors the library’s Checkbox styling in both fluent.css and fluent.min.css. Flow diagram for Fluent input-group checkbox stylingflowchart LR
A[Checkbox inside input-group] --> B[.input-group > .form-check .form-check-input]
B --> C[margin: 3px 0 1px 0]
C --> D[Checkbox remains centered within flex cell]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Pull request overview
This pull request fixes a Fluent theme layout regression where the standalone checkbox negative-margin metric rule (margin-left: -28px) incorrectly affects checkboxes rendered inside BootstrapInputGroup, pulling the indicator into the input-group cell border.
Changes:
- Add a more specific Fluent CSS override for
.input-group > .form-check .form-check-inputto restore the library’s intended checkbox margins inside input groups. - Synchronize the same rule into both
fluent.cssandfluent.min.css.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/components/BootstrapBlazor.Theme.Fluent/wwwroot/fluent.css | Adds an input-group-scoped .form-check-input margin override (with explanatory comment) to counteract the standalone negative-margin rule. |
| src/components/BootstrapBlazor.Theme.Fluent/wwwroot/fluent.min.css | Mirrors the same override in the minified asset to keep runtime behavior consistent. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Link issues
fixes #1107
Summary By Copilot
Fluent 主题的独立复选框度量规则为
.form-check-input设置了margin-left: -28px(配合独立布局padding-left: 28px的负边距技巧),与组件库.form-check .form-check-input同为 0-2-0 优先级但后加载,导致BootstrapInputGroup内的Checkbox(组件库布局为居中 flex 单元格,padding-left为.75rem)被向左拖动 28px、压到单元格边框上。本 PR 针对 input-group 场景补充.input-group > .form-check .form-check-input { margin: 3px 0 1px 0; }恢复规则(0-3-0,高于主题度量规则且后加载),同步更新fluent.css与fluent.min.css。Regression?
Risk
仅新增一条 input-group 场景的边距恢复规则,独立复选框、Switch、尺寸变体均不受影响。
Verification
依据组件库
BootstrapInputGroup.razor.scss/Checkbox.razor.scss的层叠关系核对,规则优先级与加载顺序均已验证(min.css 中位于负边距规则之后)。Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Restore proper checkbox positioning in Fluent input groups without changing standalone checkbox or switch layouts.
Bug Fixes:
Chores: