本文共 2045 字,大约阅读时间需要 6 分钟。
ruby - v//如安装成功会打印ruby 2.2.2p95 (2015-04-13 revision 50295) [i386-mingw32]
//1.删除原gem源gem sources --remove https://rubygems.org///2.添加国内源gem sources -a http://gems.ruby-china.com/--------------(2019.7.7测试成功)//3.测试是否替换成功gem sources -l//成功打印如下结果*** CURRENT SOURCES ***http://gems.ruby-china.com///如果没有成功就去找其它可用的源//4.安装sassgem install sass//5.安装compassgem install compass//6.安装成功测试sass -v结果>>Sass 3.x.x (Selective Steve)compass -v结果>>Compass 1.0.3 (Polaris)Copyright (c) 2008-2019 Chris EppsteinReleased under the MIT License.Compass is charityware.Please make a tax deductable donation for a worthy cause: http://umdf.org/compass
gem update sass
sass -v
sass -h
命令行编译
sass input.scss output.css
sass --watch input.scss:output.css
sass -watch app/sass:public/stylesheets
sass --watch input.scss:output.css --style compact
sass --watch input.scss:output.css --sourcemap
sass --watch input.scss:output.css --style expanded --sourcemap
sass --watch input.scss:output.css --debug-info
//未编译样式.box { width: 300px; height: 400px; &-title { height: 30px; line-height: 30px; }}
/*命令行内容*/sass style.scss:style.css --style nested/*编译过后样式*/.box { width: 300px; height: 400px; } .box-title { height: 30px; line-height: 30px; }
/*命令行内容*/sass style.scss:style.css --style expanded/*编译过后样式*/.box { width: 300px; height: 400px;}.box-title { height: 30px; line-height: 30px;}
/*命令行内容*/sass style.scss:style.css --style compact/*编译过后样式*/.box { width: 300px; height: 400px; }.box-title { height: 30px; line-height: 30px; }
/*命令行内容*/sass style.scss:style.css --style compressed/*编译过后样式*/.box{width:300px;height:400px}.box-title{height:30px;line-height:30px}
转载地址:http://mczfi.baihongyu.com/