Is there any way to use @if in a Theme Component using a variable?

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" {
  ...
}
4 Likes