2015-05-24 66 views
5

我在我的.sass文件中使用Unicode轉義,我想保留,但上海社會科學院正在創建輸出一個奇怪的字符。如何解決這個問題?薩斯:Unicode轉義不會保留.css文件

我使用的是Mac和薩斯版本3.4.13。

[email protected] /tmp $ cat new.sass 
.icon-ok 
    &:before 
    content: "\e601" 
[email protected] /tmp $ sass new.sass new.css 
[email protected] /tmp $ cat new.css 
@charset "UTF-8"; 
.icon-ok:before { 
    content: ""; } 

/*# sourceMappingURL=new.css.map */ 
+0

還涉及:http://stackoverflow.com/questions/25677306/sass-3 -4-1轉義-A-270E-成-270E-其中-斷裂-A-字體圖標 – cimmanon

回答

6

它是known issue。有一種變通方法,可在@tjbenton後發現在GitHub上:

@charset "UTF-8" 

@function unicode($str) 
    @return unquote("\"")+unquote(str-insert($str, "\\", 1))+unquote("\"") 

.icon-ok 
    &:before 
    content: unicode("e601") 

輸出:

.icon-ok:before { 
    content: "\e601"; 
}