css colour classes: conditions for selection colours on white and black backgrounds

This commit is contained in:
2026-02-11 12:41:36 +00:00
parent 6cdc56b5a4
commit f037551789

View File

@@ -1,4 +1,5 @@
@use "text-contrast";
@use "../variables/colours";
@use "sass:color";
@@ -22,6 +23,16 @@
::selection {
@include text-contrast.text_contrast(color.invert($hex));
background: color.invert($hex);
@if($name == "white") {
color: colours.$white;
background: colours.$primary;
} @else if($name == "black") {
color: colours.$white;
background: colours.$primary-lighter;
} @else {
@include text-contrast.text_contrast(color.invert($hex));
background: color.invert($hex);
}
}
}
}