为什么使用SVG核心设置Fontawesome默认情况下禁用这些选项?
我正在尝试使我的 fontawesome 6 通过导入我使用的几个单独的图标而不是我使用的几个单独的图标,而不是安装更轻量级整个样式,通过我的Web应用程序的npm
构建过程。文档似乎说做到这一点是通过安装@fortawesome/fontawesome-svg-core (然后大概是一个图标包,例如
@fortawesome/fortawesome/fore-solid-svg-icons
,尽管文档中未明确提及)。
以这种方式使用fontawesome 默认情况下禁用标准Fontawesome配置的以下功能:
用
自动替换< svg>
< i>
观看图标更改的页面
内容,文档的另一部分 A>表明禁用的特定选项为AutorePlaceSvg
和observemutations
。
默认情况下,以这种方式配置fontawesome的原因是什么,并且重新实现它们(性能或其他方式)是否有任何不利条件?
I'm trying to make my FontAwesome 6 installation more lightweight by importing the few individual icons I'm using instead of a whole style, via my web app's npm
build process. The documentation seems to say that the way to do this is by installing @fortawesome/fontawesome-svg-core
(and then presumably an icon pack like @fortawesome/free-solid-svg-icons
, although not explicitly mentioned in the docs).
Using FontAwesome in this way disables by default the following capabilities of the standard FontAwesome configuration:
Automatically replaces
<i>
tags with<svg>
Watches the page for icon changes and additions
Going deeper into this, another section of the docs shows that the specific options disabled are autoReplaceSvg
and observeMutations
.
What are the reason(s) that configuring FontAwesome in this way disables these options by default, and is there any disadvantage to re-enabling them, either performance or otherwise?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
大约一天之后,我在另一部分 (非常广泛的)文档:
A day or so later, I found this by chance in another section of the (very extensive) documentation: