我想在 Bootstrap 4 中创建一个带有白色(#fff)文本颜色的新按钮样式。Mixinbutton-variant
会根据背景颜色自动设置文本颜色。如何在不修改的情况下同时使用这个 mixin 并设置颜色_buttons.scss
?
自定义.scss
.my_button {
@include button-variant(HOW TO SET TEXT COLOR TO WHITE?);
}
_buttons.scss
@mixin button-variant($background, $border, $hover-background: darken($background, 7.5%), $hover-border: darken($border, 10%), $active-background: darken($background, 10%), $active-border: darken($border, 12.5%)) {
color: color-yiq($background);
@include gradient-bg($background);
border-color: $border;
@include box-shadow($btn-box-shadow);
@include hover {
color: color-yiq($hover-background);
@include gradient-bg($hover-background);
border-color: $hover-border;
}