refactor(button): remove redundant style codes

This commit is contained in:
07akioni 2020-05-15 22:33:54 +08:00
parent 259d2350b5
commit e31ae14823

View File

@ -81,12 +81,12 @@
@mixin button-icon-mixin($color) { @mixin button-icon-mixin($color) {
@include e(icon) { @include e(icon) {
@include b(icon) { @include b(icon) {
fill: $color !important; fill: $color;
stroke: $color !important; stroke: $color;
} }
@include b(base-loading) { @include b(base-loading) {
fill: $color !important; fill: $color;
stroke: $color !important; stroke: $color;
} }
} }
} }
@ -184,29 +184,25 @@
} }
} }
@include m(text) { @include m(text) {
@include button-icon-mixin(map-get($--button-ghost-typed-text-color, $type));
color: map-get($--button-text-typed-text-color, $type); color: map-get($--button-text-typed-text-color, $type);
@include button-icon-mixin(map-get($--button-ghost-typed-text-color, $type));
@include not-m(disabled) { @include not-m(disabled) {
@include m(enter-pressed) { @include m(enter-pressed) {
background-color: transparent;
color: map-get($--button-text-typed-text-color, $type + '-active'); color: map-get($--button-text-typed-text-color, $type + '-active');
@include button-icon-mixin(map-get($--button-ghost-typed-text-color, $type + '-active')); @include button-icon-mixin(map-get($--button-ghost-typed-text-color, $type + '-active'));
} }
&:not(:active):focus { &:not(:active):focus {
@include not-m(enter-pressed) { @include not-m(enter-pressed) {
background-color: transparent;
color: map-get($--button-text-typed-text-color, $type + '-focus'); color: map-get($--button-text-typed-text-color, $type + '-focus');
@include button-icon-mixin(map-get($--button-ghost-typed-text-color, $type + '-focus')); @include button-icon-mixin(map-get($--button-ghost-typed-text-color, $type + '-focus'));
} }
} }
@include not-m(enter-pressed) { @include not-m(enter-pressed) {
&:hover { &:hover {
background-color: transparent;
color: map-get($--button-text-typed-text-color, $type + '-hover'); color: map-get($--button-text-typed-text-color, $type + '-hover');
@include button-icon-mixin(map-get($--button-ghost-typed-text-color, $type + '-hover')); @include button-icon-mixin(map-get($--button-ghost-typed-text-color, $type + '-hover'));
} }
&:active { &:active {
background-color: transparent;
color: map-get($--button-text-typed-text-color, $type + '-active'); color: map-get($--button-text-typed-text-color, $type + '-active');
@include button-icon-mixin(map-get($--button-ghost-typed-text-color, $type + '-active')); @include button-icon-mixin(map-get($--button-ghost-typed-text-color, $type + '-active'));
} }