diff --git a/scss/_radios.scss b/scss/_radios.scss index e08d0416..ad429447 100644 --- a/scss/_radios.scss +++ b/scss/_radios.scss @@ -1,30 +1,27 @@ -.radio label span { - top: 0; -} -label.radio-inline span { - top: (($line-height * $font-size-base) - $mdb-radio-size) / 2; -} - .radio label, label.radio-inline { position: relative; + padding-left: $mdb-radio-size + $mdb-radio-label-padding; // absolutely positioned so add the radio size span { position: absolute; + top: (($line-height * $font-size-base) - $mdb-radio-size) / 2; // vertical center of line-height left: 0; - display: block; + display: inline-block; width: $mdb-radio-size; height: $mdb-radio-size; transition-duration: 0.2s; &.mdb-radio-outer-circle { border: $mdb-radio-border solid $mdb-radio-color-off; - border-radius: 100%; + border-radius: 50%; + transition: border-color ease .28s; } &.mdb-radio-inner-circle { display: inline-block; background-color: $mdb-radio-color-on; border-radius: 50%; + transition: transform ease .28s; transform: scale3d(0, 0, 0); // focus/press ripple diff --git a/scss/_variables.scss b/scss/_variables.scss index a672e538..dd7eeda0 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -97,7 +97,8 @@ $mdb-dropdown-font-size: 16px !default; // Radio: $mdb-radio-border: .125rem !default; // 2px -$mdb-radio-size: 1rem !default; +$mdb-radio-size: 1.25rem !default; +$mdb-radio-label-padding: .3125rem !default; // 5px $mdb-radio-color-off: $mdb-label-color-inner-focus !default; // FIXME seems inconsistent, check spec $mdb-radio-color-on: $brand-primary !default; diff --git a/scss/mixins/_forms.scss b/scss/mixins/_forms.scss index 05d2b4ea..8e94af12 100644 --- a/scss/mixins/_forms.scss +++ b/scss/mixins/_forms.scss @@ -20,8 +20,8 @@ } // correct the above focus color for disabled items - label:has(input[type=radio][disabled]), // css 4 which is unlikely to work for a while, but no other pure css way. - label:has(input[type=checkbox][disabled]), // css 4 + label:has(input[type=radio][disabled]), // css 4 which is unlikely to work for a while, but no other pure css way. + label:has(input[type=checkbox][disabled]), // css 4 fieldset[disabled] & { &, &:hover, @@ -53,7 +53,6 @@ } } - @mixin mdb-form-color($label-color, $label-color-focus, $border-color) { [class^='mdb-label'], @@ -145,6 +144,13 @@ line-height: $variant-line-height; } + .radio label, + label.radio-inline, + .checkbox label, + label.checkbox-inline { + line-height: $line-height; // keep the same line height for radios and checkboxes + } + // Note: this may be inside or outside a form-group, may be .mdb-form-group.mdb-form-group-sm or .mdb-form-group.mdb-form-group-lg input::placeholder { font-size: $font-size;