This works as expected:
@if $condition @def $value = "foo";
@else @def $value = "bar";
but this does not:
@if $condition {
@def $value = "foo";
} @else {
@def $value = "bar";
}
because $value is only defined in the blocks, not the surrounding scope,
which makes it useless.
(This is simplified from a practical case, where I'd like the
condition to control several definitions of variables, functions, etc.
Instead I have to push the condition down inside each definition as an
ugly workaround.)