aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Rebert <[email protected]>2014-06-05 13:31:39 -0700
committerChris Rebert <[email protected]>2014-06-06 17:23:28 -0700
commit739bf379a93a2a396e23f0423167b3552eb88191 (patch)
tree1104a4e92c08462478ae1fa1cacd12b324342475
parentef436c761b9587fbd0234788ec8bed4696aec516 (diff)
downloadbootstrap-739bf379a93a2a396e23f0423167b3552eb88191.tar.xz
bootstrap-739bf379a93a2a396e23f0423167b3552eb88191.zip
set not-allowed cursor on disabled radio+checkbox labels; fixes #13281
[skip validator] [skip sauce]
-rw-r--r--dist/css/bootstrap.css20
-rw-r--r--less/forms.less24
2 files changed, 33 insertions, 11 deletions
diff --git a/dist/css/bootstrap.css b/dist/css/bootstrap.css
index b172acc5b..87855926d 100644
--- a/dist/css/bootstrap.css
+++ b/dist/css/bootstrap.css
@@ -2440,18 +2440,24 @@ input[type="month"].input-lg {
}
input[type="radio"][disabled],
input[type="checkbox"][disabled],
-.radio[disabled],
-.radio-inline[disabled],
-.checkbox[disabled],
-.checkbox-inline[disabled],
+input[type="radio"].disabled,
+input[type="checkbox"].disabled,
fieldset[disabled] input[type="radio"],
-fieldset[disabled] input[type="checkbox"],
-fieldset[disabled] .radio,
+fieldset[disabled] input[type="checkbox"] {
+ cursor: not-allowed;
+}
+.radio-inline.disabled,
+.checkbox-inline.disabled,
fieldset[disabled] .radio-inline,
-fieldset[disabled] .checkbox,
fieldset[disabled] .checkbox-inline {
cursor: not-allowed;
}
+.radio.disabled label,
+.checkbox.disabled label,
+fieldset[disabled] .radio label,
+fieldset[disabled] .checkbox label {
+ cursor: not-allowed;
+}
.input-sm {
height: 30px;
padding: 5px 10px;
diff --git a/less/forms.less b/less/forms.less
index cb8a74fa1..b678d44fc 100644
--- a/less/forms.less
+++ b/less/forms.less
@@ -247,19 +247,35 @@ input[type="month"] {
}
// Apply same disabled cursor tweak as for inputs
+// Some special care is needed because <label>s don't inherit their parent's `cursor`.
//
// Note: Neither radios nor checkboxes can be readonly.
input[type="radio"],
-input[type="checkbox"],
-.radio,
+input[type="checkbox"] {
+ &[disabled],
+ &.disabled,
+ fieldset[disabled] & {
+ cursor: not-allowed;
+ }
+}
+// These classes are used directly on <label>s
.radio-inline,
-.checkbox,
.checkbox-inline {
- &[disabled],
+ &.disabled,
fieldset[disabled] & {
cursor: not-allowed;
}
}
+// These classes are used on elements with <label> descendants
+.radio,
+.checkbox {
+ &.disabled,
+ fieldset[disabled] & {
+ label {
+ cursor: not-allowed;
+ }
+ }
+}
// Form control sizing