我想为不同的浏览器提供不同的字体(参见this question)。
有没有一种巧妙的方法来解决Sass/Bourbon的问题?
到目前为止,我的情况如下:
<!--[if IE]> -->
@include font-face("myicons", "myicons", $weight: normal, $style: normal,
$asset-pipeline: false);
<![endif]-->
<!--[if !IE]> -->
@include font-face("myicons", "myicons", $weight: normal, $style: normal,
$asset-pipeline: true);
<![endif]-->发布于 2014-08-21 21:17:07
这个问题超出了sass的范围,因为它只是一个预处理器,对浏览器没有任何线索。也是css作用域之外,决定不同浏览器的条件。
您可以这样做,将ie8类添加到html中,就像html5样板所做的那样,然后使用css规则激活字体。
body {
@include font-face("myicons", "myicons", $weight: normal, $style: normal, $asset-pipeline: false);
.ie8 & {
@include font-face("myicons", "myicons", $weight: normal, $style: normal, $asset-pipeline: true);
}
}在html文件中
<!--[if IE 8]> <html class="ie8"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->https://stackoverflow.com/questions/25435024
复制相似问题