Closed mhulse closed 11 years ago
Looks like SASS doesn't allow for @import
s to be used inside an @if ...
. When I try, I get:
./files/styles/_master.scss:109: Import directives may not be used within control directives or mixins. (Sass::SyntaxError)
Possible solution is to use a mixin, like:
@import
in @if
statement in SASS
Here's the Official reasoning for this limitation:
It was never intended that
@import
would work in a conditional context, this makes it impossible for us to build a dependency tree for recompilation without fully executing the file -- which would be simply terrible for performance.
Going to shelve this issue for now; I'll re-open/create new issue if/when it's needed in future.
I ended up making the baseline class a mixin, used like so:
@if $flag_baseline {
.#{$NS}baseline {
@include baseline-grid;
}
}
_baseline.scss
, so it can be used all by its lonesome in other projects.