1.下載軟件
官網地址:https://sass-lang.com/dart-sass
github下載地址:https://github.com/sass/dart-sass/releases/tag/1.32.8
2.配置環境變量
在path環境變量中添加C:\Users\gmbjzg\software\dart-sass
3.環境測試
打開cmd, 輸入以下命令
sass --version
4.dart-sass與sublime的結合
1.工具>編譯系統>編譯新系統
{
"cmd": ["sass", "--update", "$file:${file_path}/../css/${file_base_name}.css", "--stop-on-error"],
"selector": "source.sass, source.scss",
"line_regex": "Line ([0-9]+):",
"windows":
{
"shell": "true"
}
}
sass命令:
sass -h
1)--update
編譯
2)編譯后css目錄
$file:${file_path}/../css/${file_base_name}.css
3)編譯時遇到error錯誤則終止腳本
--stop-on-error
4)擴展版
--style expanded
5)壓縮版
--style compressed
6)生成map文件
--source-map
2.環境測試
新建index.scss源文件
/*變量的定義*/
$bgc:#ff5;
body {
background-color: $bgc;
}
ctrl + b
編譯代碼