Runtime CSS variables like --my-variable
can’t be consumed in SASS/SCSS build-time @if
statements.
So I think you’d have to handle this entirely at build-time, sticking to SCSS variables only. Something like:
@if $my_boolean_setting_in_theme == "true" {
...
}