Skip to content

Keep the checked look on disabled toggle buttons - #43350

Merged
mdo merged 2 commits into
twbs:mainfrom
vladosskins178:fix/btn-check-disabled-checked
Nov 20, 2026
Merged

mdo merged 2 commits into
twbs:mainfrom
vladosskins178:fix/btn-check-disabled-checked

Conversation

@vladosskins178

Copy link
Copy Markdown
Contributor
  • A disabled .btn-check took the disabled colors even when its input was checked. The disabled rule came after the checked rule with the same specificity, so it won. In a group of disabled radios, no option looked selected.
  • .btn-check:has(input:disabled) now keeps only pointer-events, opacity and box-shadow. The disabled colors move to .btn-check:has(input:disabled):not(:has(input:checked)).
  • A disabled checked toggle now shows its checked colors at the disabled opacity. This matches v5, where .btn-check:disabled + .btn changed only the opacity. Unchecked disabled toggles do not change.

Computed styles in Chromium, built from main and from this branch (radio group from the issue, .btn-outline.theme-secondary):

Toggle main This branch
Disabled, checked background transparent, opacity 0.65 background oklch(0.828 0.005 245), opacity 0.65 (same as enabled checked)
Disabled, not checked background transparent, opacity 0.65 unchanged

npm run css-lint and npm run css-test pass.

Fixes #43348

@vladosskins178
vladosskins178 requested a review from a team as a code owner November 11, 2026 10:06
@julien-deramond julien-deramond added v6 v6, the main branch bug Something does not work as documented css Sass sources or compiled CSS labels Nov 11, 2026
@netlify

netlify Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for twbs-bootstrap ready!

Name Link
🔨 Latest commit 9aea83c
🔍 Latest deploy log https://app.netlify.com/projects/twbs-bootstrap/deploys/6b00946ec3752c8670573da0
😎 Deploy Preview https://deploy-preview-43350--twbs-bootstrap.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

vladosskins178 and others added 2 commits November 20, 2026 10:41
A disabled .btn-check took the disabled colors even when its input was checked.
The rule came after the checked rule with the same specificity, so it won.
A group of disabled radios then showed no selected option.

The disabled rule now keeps pointer-events, opacity and box-shadow for every
disabled toggle. It applies the disabled colors only when the input is not checked.
Show that the checked option remains visible when all radios are disabled.
@mdo
mdo force-pushed the fix/btn-check-disabled-checked branch from 626021e to 9aea83c Compare November 20, 2026 18:41
@mdo
mdo merged commit 58e3a70 into twbs:main Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something does not work as documented css Sass sources or compiled CSS v6 v6, the main branch

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

Disabled radio toggle button groups lose checked state

3 participants