@import in @if statement in SASS

rolandcattle

New Member
I want to load only the css needed for the login page for performance. On my other pages i want a grouped css file that will be cached on every page which contain all my css.so I want basically\[code\]minifiedcssforloginpage.cssgrouped-pages.css\[/code\]in minifiedcssforloginpage.scss i declare $load-complete-css:false. Afterwards I import myproject.scss which contains all the imports of my modules, layouts, core... In myproject.scss i want to do something like\[code\]@if $load-complete-css { @import module1; @import module2; @import module3;}\[/code\]so minifiedcssforloginpage.scss would generate minifiedcssforloginpage.css with less css then grouped-pages.css (that has a var $load-complete-css set to true)But i get an error that this is not possible "Import directives may not be used within control directives or mixins".Am I thinking wrong? Any suggestion welcome!
 
Back
Top