我想为不同的浏览器提供不同的字体(请参阅这个问题).
有没有一种巧妙的方法可以用 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]-->
这个问题超出了 sass 范围,因为它只是一个预处理器,并且没有关于浏览器的线索。
也是在 css 范围之外决定不同浏览器的条件。
您可以像 html5 样板一样向 html 添加 ie8 类,然后使用 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]-->
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)