SASS ignores variables, defined in if-statement
问题 I have one file named style.scss with the following code: @import 'variables'; body { color: $text-color; background: $background-color; } And one partial named _variables.scss: $colorscheme: white; @if $colorscheme == white { $text-color: #333; $background-color: #fff; } @else { $text-color: #ccc; $background-color: #333; } The if-statement works properly, but the variables defined inside, do not work. When I try to compile it, I keep getting: Syntax error: Undefined variable: “$text-color”.