目录

Import directives may not be used within control directives or mixins.

升级 gulp-sass后报错 Import directives may not be used within control directives or mixins.

1
2
3
@if compass-env() == 'development' {
    @import 'debug'; #导入样式表
}

改为:

1
2
3
4
5
@if compass-env() == 'development' {
    body {
        color: red; #改为内置样式表
    }
}

测试环境 Sass 3.2.5 + Compass 0.12.2 + Ruby 1.9.3p194.

全局安装gulp-sass后仍然提示gulp 未安装 目前原因不明, 路径设置也设置了全局路径, 依然不生效,只好在本地再次安装 package.json包 npm install --save-dev

原文链接 stackoverflow- Sass Conditionals Based on Environment Setting