pull in v11.0.1 from upstream
This commit is contained in:
66
resources/css/global/mixins/_generate-button-classes.scss
Normal file
66
resources/css/global/mixins/_generate-button-classes.scss
Normal file
@@ -0,0 +1,66 @@
|
||||
@use "sass:color";
|
||||
|
||||
@mixin generate_button_colors($name, $hex) {
|
||||
|
||||
$buttons: (
|
||||
".button",
|
||||
"button",
|
||||
"input[type=submit]",
|
||||
);
|
||||
|
||||
@each $button in $buttons {
|
||||
#{$button}.#{$name} {
|
||||
color: $white;
|
||||
background: $hex;
|
||||
border-color: $hex;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: $white;
|
||||
background: color.adjust($hex, $lightness: 10%);
|
||||
border-color: color.adjust($hex, $lightness: 10%);
|
||||
}
|
||||
}
|
||||
|
||||
#{$button}.#{$name}.inverted {
|
||||
color: $hex;
|
||||
background: transparent;
|
||||
border-color: $hex;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: white;
|
||||
background: #{$hex};
|
||||
border-color: #{$hex};
|
||||
}
|
||||
}
|
||||
|
||||
@media screen {
|
||||
*:not(.bg-#{$name}) #{$button}.#{$name} {
|
||||
color: white;
|
||||
background-color: $hex;
|
||||
border-color: $hex;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: white;
|
||||
background-color: color.adjust($hex, $lightness: 10%);
|
||||
border-color: color.adjust($hex, $lightness: 10%);
|
||||
}
|
||||
}
|
||||
|
||||
.bg-#{$name} #{$button}.#{$name} {
|
||||
color: $hex;
|
||||
background: white;
|
||||
border-color: white;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: white;
|
||||
background: transparent;
|
||||
border-color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user