From 8b7b234fd1c840a23ac2ca2ba69a3a2a2abf3100 Mon Sep 17 00:00:00 2001 From: Martijn Cuppens Date: Thu, 4 Jun 2020 15:59:24 +0200 Subject: [PATCH] Switch to btn-check --- scss/_button-group.scss | 6 ++--- scss/_buttons.scss | 6 ++--- scss/forms/_form-check.scss | 2 +- scss/mixins/_buttons.scss | 12 ++++----- site/content/docs/5.0/components/buttons.md | 2 +- site/content/docs/5.0/forms/checks.md | 28 ++++++++++----------- site/content/docs/5.0/migration.md | 2 +- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/scss/_button-group.scss b/scss/_button-group.scss index a2cf7cf274..8be6c0f52f 100644 --- a/scss/_button-group.scss +++ b/scss/_button-group.scss @@ -14,8 +14,8 @@ // Bring the hover, focused, and "active" buttons to the front to overlay // the borders properly - > .btn-toggle:checked + .btn, - > .btn-toggle:focus + .btn, + > .btn-check:checked + .btn, + > .btn-check:focus + .btn, > .btn:hover, > .btn:focus, > .btn:active, @@ -51,7 +51,7 @@ // - Target second buttons which are not part of toggle buttons // - Target third or more child // - Target buttons in a button group - > :not(.btn-toggle) + .btn, + > :not(.btn-check) + .btn, > .btn:nth-child(n + 3), > .btn-group:not(:first-child) > .btn { @include border-left-radius(0); diff --git a/scss/_buttons.scss b/scss/_buttons.scss index 67c70de3b1..e17d4895e1 100644 --- a/scss/_buttons.scss +++ b/scss/_buttons.scss @@ -24,14 +24,14 @@ text-decoration: if($link-hover-decoration == underline, none, null); } - .btn-toggle:focus + &, + .btn-check:focus + &, &:focus { outline: 0; box-shadow: $btn-focus-box-shadow; } - .btn-toggle:checked + &, - .btn-toggle:active + &, + .btn-check:checked + &, + .btn-check:active + &, &:active, &.active { @include box-shadow($btn-active-box-shadow); diff --git a/scss/forms/_form-check.scss b/scss/forms/_form-check.scss index fef7be6fe0..f1635780fe 100644 --- a/scss/forms/_form-check.scss +++ b/scss/forms/_form-check.scss @@ -135,7 +135,7 @@ margin-right: $form-check-inline-margin-right; } -.btn-toggle { +.btn-check { position: absolute; clip: rect(0, 0, 0, 0); pointer-events: none; diff --git a/scss/mixins/_buttons.scss b/scss/mixins/_buttons.scss index e8655105d5..09ef0cb38c 100644 --- a/scss/mixins/_buttons.scss +++ b/scss/mixins/_buttons.scss @@ -25,7 +25,7 @@ border-color: $hover-border; } - .btn-toggle:focus + &, + .btn-check:focus + &, &:focus { color: $hover-color; @include gradient-bg($hover-background); @@ -38,8 +38,8 @@ } } - .btn-toggle:checked + &, - .btn-toggle:active + &, + .btn-check:checked + &, + .btn-check:active + &, &:active, &.active, .show > &.dropdown-toggle { @@ -85,13 +85,13 @@ border-color: $active-border; } - .btn-toggle:focus + &, + .btn-check:focus + &, &:focus { box-shadow: 0 0 0 $btn-focus-width rgba($color, .5); } - .btn-toggle:checked + &, - .btn-toggle:active + &, + .btn-check:checked + &, + .btn-check:active + &, &:active, &.active, &.dropdown-toggle.show { diff --git a/site/content/docs/5.0/components/buttons.md b/site/content/docs/5.0/components/buttons.md index cc0887487e..fbd9600dcd 100644 --- a/site/content/docs/5.0/components/buttons.md +++ b/site/content/docs/5.0/components/buttons.md @@ -103,7 +103,7 @@ The `.disabled` class uses `pointer-events: none` to try to disable the link fun ## Button plugin -Do more with buttons. Control button states or create groups of buttons for more components like toolbars. +The button plugin allows you to create simple on/off toggle buttons. ### Toggle states diff --git a/site/content/docs/5.0/forms/checks.md b/site/content/docs/5.0/forms/checks.md index fec40b962b..a8b3666258 100644 --- a/site/content/docs/5.0/forms/checks.md +++ b/site/content/docs/5.0/forms/checks.md @@ -214,16 +214,16 @@ Omit the wrapping `.form-check` for checkboxes and radios that have no label tex ### Checkbox toggle buttons -Bootstrap's `.btn` styles can be applied to `