I’m trying to use the dark-light-choose($light, $dark) function in my personalized CSS but it always returns $light even if I change the palette from light (Clara) to dark (Oscura):
I believe, due to the way the SCSS is compiled, custom dark/light definitions need to be added to color_definitions.scss within a theme and won’t work in other scss files.
color_definitions.scss is high up in the cascade (before a lot of the default styles), so you don’t want to add the .modal.history-modal ins part there. Instead you can just add the color definition itself…
Thank you so much, Kris. You saved me! It works perfectly
I’ve been playing around with it and the only thing I don’t understand is why variable interpolation is required with color values. For example, this doesn’t work without interpolation:
$ins: #7f7e7e;
:root {
--custom-ins: $ins;
}
But this does:
$ins: #7f7e7e;
:root {
--custom-ins: #{$ins};
}
Both versions work if $ins is assigned a variable (for example: $ins: $dark-theme-ins ).