aboutsummaryrefslogtreecommitdiff
path: root/less/forms.less
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2014-06-08 11:05:39 -0700
committerMark Otto <[email protected]>2014-06-08 11:05:39 -0700
commit7231efabde1fb58576d7f05194218e888a9a70c8 (patch)
tree9b6371d074767075b349c26d82a2ba92fbfb7bde /less/forms.less
parent5fd8ca9089aaaf9af2bf9282f3b95343db896eb9 (diff)
parentdd7ee517e4541cddf98b46feb8b35d1568ff2346 (diff)
downloadbootstrap-7231efabde1fb58576d7f05194218e888a9a70c8.tar.xz
bootstrap-7231efabde1fb58576d7f05194218e888a9a70c8.zip
Merge pull request #13745 from twbs/fix-13281
set not-allowed cursor on disabled radio+checkbox labels
Diffstat (limited to 'less/forms.less')
-rw-r--r--less/forms.less24
1 files changed, 20 insertions, 4 deletions
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