Skip to content

fix(Fluent): restore checkbox margins inside input-group - #1108

Merged
ArgoZhang merged 2 commits into
BootstrapBlazor:masterfrom
h2ls:fix/fluent-input-group-checkbox
Aug 25, 2026
Merged

fix(Fluent): restore checkbox margins inside input-group#1108
ArgoZhang merged 2 commits into
BootstrapBlazor:masterfrom
h2ls:fix/fluent-input-group-checkbox

Conversation

@h2ls

@h2ls h2ls commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

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.cssfluent.min.css

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

仅新增一条 input-group 场景的边距恢复规则,独立复选框、Switch、尺寸变体均不受影响。

Verification

  • Manual (required)
  • Automated

依据组件库 BootstrapInputGroup.razor.scss / Checkbox.razor.scss 的层叠关系核对,规则优先级与加载顺序均已验证(min.css 中位于负边距规则之后)。

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Restore proper checkbox positioning in Fluent input groups without changing standalone checkbox or switch layouts.

Bug Fixes:

  • Restore checkbox margins inside Fluent-themed input groups so BootstrapInputGroup checkboxes remain correctly positioned within their cells.

Chores:

  • Regenerate the Fluent theme CSS assets to include the input-group checkbox margin correction.

Copilot AI lite review requested due to automatic review settings August 24, 2026 07:23
@bb-auto

bb-auto Bot commented Aug 24, 2026

Copy link
Copy Markdown

Thanks for your PR, @h2ls. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@bb-auto
bb-auto Bot requested a review from ArgoZhang August 24, 2026 07:23
@bb-auto bb-auto Bot added the bug Something isn't working label Aug 24, 2026
@bb-auto bb-auto Bot added this to the v10.0.0 milestone Aug 24, 2026
@sourcery-ai

sourcery-ai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds 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 styling

flowchart 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]
Loading

File-Level Changes

Change Details Files
Override Fluent standalone checkbox negative-margin behavior for checkboxes inside Bootstrap input groups to match the component library’s intended margins.
  • Adds a specific input-group selector for checkboxes to reset margins to the library’s Checkbox values, with higher specificity than the standalone Fluent checkbox metric rule.
  • Documents in a CSS comment why the override is needed, referencing the flex layout of .input-group > .form-check and the interaction with the negative-margin rule.
  • Updates the minified fluent.min.css so the new override is present after the negative-margin rule in the minified bundle.
src/components/BootstrapBlazor.Theme.Fluent/wwwroot/fluent.css
src/components/BootstrapBlazor.Theme.Fluent/wwwroot/fluent.min.css

Assessment against linked issues

Issue Objective Addressed Explanation
#1107 修复 Fluent 主题下 BootstrapInputGroup 内 Checkbox 被独立复选框的负左边距规则向左拖动、导致显示异常的问题。
#1107 在 Fluent 的未压缩和压缩 CSS 文件中为 input-group 场景恢复组件库 Checkbox 的正确边距,同时避免影响独立复选框、Switch 和尺寸变体。

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-input to restore the library’s intended checkbox margins inside input groups.
  • Synchronize the same rule into both fluent.css and fluent.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.

ArgoZhang
ArgoZhang previously approved these changes Aug 25, 2026
@ArgoZhang
ArgoZhang merged commit 18b1282 into BootstrapBlazor:master Aug 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(Fluent): 主题复选框负边距规则导致 BootstrapInputGroup 内 Checkbox 显示异常

3 participants