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 a96a5d62d3
commit 1e414cb9bf

View File

@@ -1,4 +1,5 @@
@use "text-contrast"; @use "text-contrast";
@use "../variables/colours";
@use "sass:color"; @use "sass:color";
@@ -22,6 +23,16 @@
::selection { ::selection {
@include text-contrast.text_contrast(color.invert($hex)); @include text-contrast.text_contrast(color.invert($hex));
background: 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);
}
} }
} }
} }