Reputation: 77
I am using scss in a project. I have a variable which depending on it's value I want to determine which scss file is imported.
So I'm trying this:
$test: 1;
@if $test == 1 {
@import "./theme1.scss";
}
Error I'm getting is:
'This at-rule is not allowed here.'
Can this be done? If so how?
Upvotes: 0
Views: 1744
Reputation: 399
Import directives may not be used within control directives or mixins. It is a feature discussed in sass GitHub, but never implemented and won't be by soon.
You should just import your scss file directly without any condition.
You can find more information under the same question here.
Upvotes: 1