dart-sass開發環境搭建


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編譯代碼


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM