字体很棒-两个版本 [英] Font awesome - two versions

查看:43
本文介绍了字体很棒-两个版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

两个很棒的字体版本可以共存吗?

Can two versions of font awesome co-exist?

我们在开发环境中安装了V3.2.我们还希望在相同的环境中安装V4.3.两种版本可以共存吗?会引起任何问题吗?

We have V3.2 installed in our development environments. We would also like to install V4.3 in the same environments. Can two versions of co-exist? Would it cause any issues?

推荐答案

在某些情况下,可以并行运行2个不同的版本.

It is possible in some to run 2 different versions side by side.

例如,如果首先加载了版本5.0.13的CSS文件,然后又加载了版本4.7.0的CSS文件,则在v4.7中使用fa-前缀的所有图标将继续起作用按照最初的意图,但使用fas-前缀从v5中提供了其他图标.

For example, if the CSS file for version 5.0.13 is loaded first, and then the CSS file for version 4.7.0 loaded next, then all the icons using the fa- prefix in v4.7 will continue to work as originally intended, but with additional icons being made available from v5 using the fas- prefix.

<html><head>
    ...
    <!-- FontAwesome, used in accordance with MIT License --> 
    <link rel="stylesheet" type="text/css" media="all"
          href="/lib/font-awesome-5.0.13/web-fonts-with-css/css/fontawesome-all.min.css" />
    <link rel="stylesheet" type="text/css" media="all"
          href="/lib/font-awesome-4.7.0/css/font-awesome.min.css" />
    ...
</head><body>
    ...
    <span class="fa fa-trash"><span><!-- became trash-alt in v5 -->
    <span class="fa fa-pencil"><span><!-- became pencil-alt in v5 -->
    <span class="fas fa-truck-moving"></span><!-- not available in v4.7 -->
    ...
</body></html>

尽管从性能或最佳实践的角度上不建议这样做,但从技术上讲确实可行,并且在将代码从支持FontAwesome v4更新到v5的过渡期内,对于大型项目可能有用.

Whilst this is perhaps not recommended in terms of performance or best practice it does technically work, and may be useful for larger projects during a transitional period when updating code from supporting FontAwesome v4 to v5.

我没有与版本3和版本4并列尝试,但是上述方法可能以相同的方式工作.

I haven't tried this with versions 3 and 4 side by side, however the above method may work in the same way.

这篇关于字体很棒-两个版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆