diff --git a/less/_radios.less b/less/_radios.less index ca1c3d77..83566c4f 100644 --- a/less/_radios.less +++ b/less/_radios.less @@ -1,3 +1,18 @@ +.radio-color(@color, @opacity){ + & ~ .check, + & ~ .circle { + opacity: @opacity; + } + + & ~ .check { + background-color: @color; + } + + & ~ .circle { + border-color: @color; + } +} + .radio { label { cursor: pointer; @@ -13,7 +28,7 @@ transition-duration: 0.2s; } .circle { - border: 2px solid @mdb-radio-border-color; + border: 2px solid @mdb-radio-color-off; height: 15px; width: 15px; border-radius: 100%; @@ -22,7 +37,7 @@ height: 15px; width: 15px; border-radius: 100%; - background-color: @mdb-radio-default; + background-color: @mdb-radio-color-on; transform: scale3d(0, 0, 0); } .check:after { @@ -48,34 +63,30 @@ } } - & input[type=radio]:checked { - & ~ .check { - background-color: @mdb-radio-default; - } - & ~ .circle { - border-color: @mdb-radio-default; - } - } - - input[type=radio][disabled] ~ .check, - input[type=radio][disabled] ~ .circle { - opacity: 0.5; - } input[type=radio] { opacity: 0; height: 0; width: 0; overflow: hidden; + + &:checked { + .radio-color(@mdb-radio-color-on, 1); + } + &:checked ~ .check { + transform: scale3d(0.55, 0.55, 1); + } } - input[type=radio]:checked ~ .check { - transform: scale3d(0.55, 0.55, 1); - } - input[type=radio][disabled] ~ .circle { - border-color: @mdb-text-color-primary; - } - input[type=radio][disabled] ~ .check { - background-color: @mdb-text-color-primary; + + input[type=radio][disabled] { + + // light theme spec: Disabled: #000000, Opacity 26% + .radio-color(@black, 0.26); + + // dark theme spec: Disabled: #FFFFFF, Opacity 30% + .theme-dark & { + .radio-color(@white, 0.30); + } } } diff --git a/less/_variables.less b/less/_variables.less index e46b5bbd..83f9174d 100644 --- a/less/_variables.less +++ b/less/_variables.less @@ -53,8 +53,6 @@ //--- -@mdb-radio-default: @mdb-text-color-primary; - // -------------------- // inputs @mdb-input-placeholder-color: #BDBDBD; @@ -136,7 +134,8 @@ // Radio: @mdb-radio-label-color: @mdb-checkbox-label-color; -@mdb-radio-border-color: @mdb-checkbox-border-color; +@mdb-radio-color-off: @mdb-checkbox-border-color; +@mdb-radio-color-on: @brand-primary; // Buttons: @mdb-btn-font-size-base: 14px;