您的位置:首页 > 其它

sass编译

2015-10-12 16:05 495 查看

命令行编译

单文件转换命令
sass style.scss style.css
单文件监听命令
sass --watch style.scss:style.css
文件夹监听命令
sass --watch sassFileDirectory:cssFileDirectory
css文件转成sass/scss文件(在线转换工具css2sass
sass-convert style.css style.sass
sass-convert style.css style.scss

命令行其他配置选项

运行命令行帮助文档,可以获得所有的配置选项
sass -h
我们一般常用的有
--style
--sourcemap
--debug-info
等。
sass --watch style.scss:style.css --style compactsass --watch style.scss:style.css --sourcemapsass --watch style.scss:style.css --style expanded --sourcemapsass --watch style.scss:style.css --debug-info
--style
表示解析后的css是什么格式,有四种取值分别为:
nested
expanded
compact
compressed


--sourcemap
表示开启sourcemap调试。开启sourcemap调试后,会生成一个后缀名为
.css.map
文件。

--debug-info
表示开启debug信息,升级到3.3.0之后因为sourcemap更高级,这个debug-info就不太用了。

四种style生成后的css

// nested#main {  color: #fff;
background-color: #000; }  #main p {    width: 10em; }.huge {  font-size: 10em;
font-weight: bold;
text-decoration: underline; }// expanded#main {  color: #fff;
background-color: #000;}#main p {  width: 10em;}.huge {  font-size: 10em;
font-weight: bold;
text-decoration: underline;}// compact#main { color: #fff; background-color: #000; }#main p { width: 10em; }.huge { font-size: 10em; font-weight: bold; text-decoration: underline; }// compressed#main{color:#fff;background-color:#000}#main p{width:10em}.huge{font-size:10em;font-weight:bold;text-decoration:underline}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: