Files
sage/resources/css/global/mixins/_generate-colour-classes.scss

40 lines
821 B
SCSS

@use "text-contrast";
@use "../variables";
@use "sass:color";
@mixin generate_colour_classes($name, $hex) {
.#{$name} {
color: $hex;
}
.fill-#{$name} {
fill: $hex;
}
.border-#{$name} {
border-color: $hex;
}
@media screen {
.bg-#{$name} {
background-color: $hex;
::selection {
@include text-contrast.text_contrast(color.invert($hex));
background: color.invert($hex);
@if($name == "white") {
color: variables.$white;
background: variables.$primary;
} @else if($name == "black") {
color: variables.$white;
background: variables.$primary-lighter;
} @else {
@include text-contrast.text_contrast(color.invert($hex));
background: color.invert($hex);
}
}
}
}
}