1.安装
1)下载 ruby http://www.ruby-lang.org/en/downloads/
2)安装haml sass
打开Ruby的命令符面板,输入: gem install haml 和 gem install sass
3)进入相应的文件中,执行命令
sass test.scss test.css
sass --style compressed|nested|compact|expanded test.scss test.css
* nested:嵌套缩进的css代码,它是默认值。
* expanded:没有缩进的、扩展的css代码。
* compact:简洁格式的css代码。
* compressed:压缩后的css代码。
监听某个文件
sass --watch input.scss:output.css
监听目录
sass --watch app/sass:public/stylesheet
2.变量
1)默认$color:red !detault;
2)全局、局部
$color:red !global;
3)嵌套 &表示父元素选择器
3.@mixin
(1)无参数
@mixin border-radius{
-webkit-border-r