Feature request: Isolate concurrent instances of @fortawesome/fontawesome-svg-core
#20893
denke8
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem?
In a widget or micro-frontend environment, if multiple FontAwesome instances are present (in separate bundles, with different versions, i.e., v6 and v7) their injected styles conflict.
An example of this is the
.svg-inline--faclass, that does not seem to be affected with thecssPrefixconfiguration option. The V7 version seems to definewidththat alters the design of the v6 instance.The second problem is, that the
svg-corepackage uses and sets the configuration object by reference. This way, all the instances have the same configuration object, with no practical way of defining a separate configuration object for each of the instances.Feature description
Since the
svg-corepackage exposes the configuration object under the named exportconfigthere should be a way to either separate the reference fromwindow.FontAwesomeConfig, or would be even better if it created a cloned version of the config for it's internal use (that is also exported) in the first place.the same thing may also be true for
window.___FONT_AWESOME___Unless I'm mistaken
.svg-inline--fashould also be affected by thecssPrefixoptionAlternatives
I have tried to separate the window attributes by hand, by the use of ambient code in two separate JS files
isolate.js
initialize.js
These need to be separated into different files, so the code is executed in the correct order. This solution is quite far from ideal
Additional context
No response
Feature request checklist
Beta Was this translation helpful? Give feedback.
All reactions