From e04df20616819834eaec86c2d6917d94555b256d Mon Sep 17 00:00:00 2001 From: Kevin Ross Date: Tue, 15 Dec 2015 18:07:09 -0600 Subject: [PATCH] fixed disabled on checkbox --- scss/_checkboxes.scss | 41 ++++++++++++++++++++++++----------------- scss/_variables.scss | 1 + 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/scss/_checkboxes.scss b/scss/_checkboxes.scss index 65073a1a..d0e6b605 100644 --- a/scss/_checkboxes.scss +++ b/scss/_checkboxes.scss @@ -4,19 +4,6 @@ label.checkbox-inline { padding-left: 0; // Reset for Bootstrap rule cursor: pointer; - // Hide native checkbox - input[type=checkbox] { - position: absolute; - left: 0; - z-index: -1; - width: 0; - height: 0; - margin: 0; - overflow: hidden; - pointer-events: none; - opacity: 0; - } - .checkbox-decorator { position: relative; top: 3px; @@ -69,6 +56,17 @@ label.checkbox-inline { input[type=checkbox] { + // Hide native checkbox + position: absolute; + left: 0; + z-index: -1; + width: 0; + height: 0; + margin: 0; + overflow: hidden; + pointer-events: none; + opacity: 0; + &:focus + .checkbox-decorator .check::after { opacity: 0.2; } @@ -112,12 +110,21 @@ label.checkbox-inline { } } + + &[disabled], + fieldset[disabled] & { + + .checkbox-decorator .check::after, + .check::after { + background-color: $mdb-text-color-primary; + transform: rotate(-45deg); + } + + .checkbox-decorator .check, + .check { + border-color: $mdb-checkbox-border-color-disabled; + } + } } - input[type=checkbox][disabled] + .checkbox-decorator .check::after { - background-color: $mdb-text-color-primary; - transform: rotate(-45deg); - } } @keyframes checkbox-on { diff --git a/scss/_variables.scss b/scss/_variables.scss index 6283f5d2..dc207400 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -85,6 +85,7 @@ $mdb-checkbox-animation-ripple: 500ms !default; $mdb-checkbox-animation-check: 0.3s !default; $mdb-checkbox-checked-color: $brand-primary !default; $mdb-checkbox-border-color: $mdb-label-color-inner-focus !default; +$mdb-checkbox-border-color-disabled: $gray-light !default; //#bdbdbd !default; // Switches $mdb-switch-label-padding: .3125rem !default; // 5px