有沒有辦法讓sass-only
評論在SASS
?你知道的,所以輸出.css
文件不具有這些意見如何製作只有sass的評論
例如,
/* global variables */
$mainColor: #666;
/* Layout */
body {...}
將輸出
/* global variables */
/* Layout */
body {...}
有沒有辦法讓sass-only
評論在SASS
?你知道的,所以輸出.css
文件不具有這些意見如何製作只有sass的評論
例如,
/* global variables */
$mainColor: #666;
/* Layout */
body {...}
將輸出
/* global variables */
/* Layout */
body {...}
有三種選擇供您考慮。
1)使用單行註釋開始//
,就像heylookltsme已經建議:使用壓縮output style
// This comment will not be included
// in the compiled css!
2)編譯SASS。然後傳統的/* ... */
評論將不會進入CSS。
用不同的輸出樣式編譯可以用香草SASS完成,但我也推薦嘗試Compass。
請注意,您可以覆蓋輸出風格,通過與exclaimation標記開始它迫使評論總是出現在最終的CSS代碼:
/*!I really want this to appear in CSS at all times.*/
3)帶指南針,可以使SASS省略所有評論:// ...
和/* ... */
。我已經解釋瞭如何在這個答案中做到這一點:https://stackoverflow.com/a/15766439/901944
你應該有一個很好的理由去這樣。
單行註釋將不包括在編的CSS,採用//
// This comment will not be included
// in the compiled css!
http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#comments