sass

 

改用官方推荐的gem(需要ruby环境)安装gem install sass;再次编译没有问题

sass的命令行

sass test.scss:test.css //单文件转换

sass src/:lib/             //文件夹转换

 

 

*IDE的编译命令参数 --no-cache %FileName%:%FileBaseName%.css --style compact

 

*sass文件不支持中文编译?

  解决办法:找到sass安装位置,我的位置在

/Library/Ruby/Gems/2.0.0/gems/sass-3.5.5/lib/sass

  修改engine.rb文件,在最后加上一行  Encoding.default_external = Encoding.find('utf-8')

 

$声明变量(less中的@)

@at-root 跳出选择器嵌套@at-root(without:all)向上跳出所有层级(media等)

混合:@mixin name声明 @include name调用

  @mixin bilibili($opcity:50){

  //多参逗号分割,可带默认值

    opacity:$opscity;

  }

 

 

 

webpack打包的项目中添加sass全局变量 https://blog.csdn.net/winne_shen/article/details/80629787

 

posted on 2017-08-07 15:40  前路亦是故乡  阅读(140)  评论(0编辑  收藏  举报

导航