Sass 搭建环境

1. 安装rubyinstaller

  https://rubyinstaller.org/

    安装完成之后 在控制台输入 gem 命令检查是否成功

2.建立项目目录

    compass create  <项目文件夹名称>        命令使用当前目录创建项目   <创建项目文件夹>

3.编译

    编译sass : sass  或者   compass compile

    监视Sass文件 : sass --watch :

    监视文件夹 : ass --watch :   或者   compass watch

*compass watch 只监视改变的文件  如果想全部文件重新编译 : compass watch --force

4.输出风格

    compass watch --output_style xpanded / compact / compresed>

    nested   

    expanded

    compact   每个选择器一行显示

    compressed

    compass watch --output_style nested --environment production   去掉注释

   /*!  这是重要注释   */  压缩也会显示出来  -> 前面加一个感叹号


如果是中文注释

在你的安装路径里 我的是 C:\Ruby24-x64\lib\ruby\gems\2.4.0\gems\sass-3.4.25\lib\sass

module Sass下面写上

Encoding.default_external = Encoding.find('utf-8)


注意了   项目目录不要有中文地址哦,不然会报错 

    

    

你可能感兴趣的:(Sass 搭建环境)