Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FontAwesomeIcon props are converted to hardcoded "fa-*" class names, ignoring the familyPrefix setting #457

Open
hghazaryan opened this issue Oct 22, 2021 · 0 comments

Comments

@hghazaryan
Copy link

Describe the bug
Setting familyPrefix to "fa5"

import { config } from '@fortawesome/fontawesome-svg-core';
config.familyPrefix = 'fa5';

adds the correct class style rules under head > style

<head>
  <style>
    ...
    .fa5-spin {...}
    ...
  </style>
</head>

but when FontAwesomeIcon is used with a spin prop

<FontAwesomeIcon icon="spinner" spin />

the className becomes fa-spin instead of fa5-spin

<svg data-prefix="fas" data-icon="spinner" class="svg-inline--fa fa5-spinner fa-w-16 fa-spin" ...>
  <path fill="currentColor" d="..."></path>
</svg>

and as a result the .fa5-spin {...} no longer applies to the svg.fa-spin and the spinner is not spinning.

Expected behavior
<FontAwesomeIcon> props should use the familyPrefix configured by @fortawesome/fontawesome-svg-core, instead of the hardcoded fa- prefix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant