我使用默认的Sass/Bourbon混合字体。但是生成的css是错误的,由于某种原因,body
标签嵌套在@font-face
下。我没有错误,当它生成CSS,但字体不显示当然。
任何想法?
CSS输出:@font-face {
body {
font-family: AgencyFB Regular;
font-weight: normal;
font-style: normal;
src: url("../../fonts/agency/agencyfb_regular.eot");
src: url("../../fonts/agency/agencyfb_regular.eot?#iefix") format("embedded-opentype"),
url("../../fonts/agency/agencyfb_regular.woff") format("woff"),
url("../../fonts/agency/agencyfb_regular.ttf") format("truetype"),
url("../../fonts/agency/agencyfb_regular.svg#AgencyFB Regular") format("svg");
}
}
SCSS:
body {
@include font-face(AgencyFB Regular, "fonts/agency/agencyfb_regular");
font: $body-font-size;
line-height: $body-line-height;
}
Cimmanon的链接为我指明了解决问题的正确方向。谢谢!
基本上我把@include font-face(AgencyFB Regular, "fonts/agency/agencyfb_regular");
移到任何css标签之外(即:body
)。
然后在body
标签中加入font-family: AgencyFB Regular
。
:
@include font-face(AgencyFB Regular, "fonts/agency/agencyfb_regular");
body {
font-family: AgencyFB Regular;
font: $body-font-size;
line-height: $body-line-height;
}