Important: v7 introduces breaking changes. Please read this guide carefully and thoroughly test in a staging environment before upgrading.

Major Changes Overview

ChangeDescriptionImpact
fa- prefixBase class fa no longer works automatically; must use fa-solid/fa-regular/fa-brands explicitlyHigh
Icon renamesApproximately 50 icon names changed to resolve naming conflictsMedium
CSS variablesNew CSS custom properties added, legacy CSS variables deprecatedMedium
SVG frameworkSVG framework configuration options adjusted, some legacy configs no longer compatibleLow
JS APISome JavaScript methods marked as deprecated or removedLow
Removed iconsA very small number of brand icons with expired trademarks removedLow

Upgrade Steps

1Update CSS/JS References

Update CDN or package version to 7.0.0:

<!-- Old v6 -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">

<!-- New v7 -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.0/css/all.min.css">

<!-- NPM update -->
npm install @fortawesome/[email protected]
2Check Icon Prefixes

Ensure all icons use complete prefixes:

<!-- Old style (partially works in v6, no longer supported in v7) -->
<i class="fa fa-user"></i>

<!-- New style (required in v7) -->
<i class="fa-solid fa-user"></i>
<i class="fa-regular fa-user"></i>
3Handle Renamed Icons

The following icons have been renamed in v7:

Old Name (v6)New Name (v7)
fa-adjustfa-circle-half-stroke
fa-carfa-car-side
fa-clockfa-clock-four
fa-editfa-pen-to-square
fa-removefa-xmark
fa-timesfa-xmark
4Update SVG Framework Config

If using the SVG framework, adjust configuration:

// v6 old config
FontAwesomeConfig = { autoReplaceSvg: 'nest' };

// v7 new config
FontAwesomeConfig = { autoReplaceSvg: 'async' };
5Test and Verify

Thoroughly check icon display and functionality in a staging environment before deploying to production.

Breaking Changes Details

v7 removed auto-completion for the fa prefix. All icons must explicitly specify a prefix:

  • fa-solid fa-icon-name - Solid style
  • fa-regular fa-icon-name - Regular style
  • fa-brands fa-icon-name - Brand icons

v7 introduces new CSS variable naming conventions. Old variable --fa-primary-color changed to --fa-primary-color-h, --fa-primary-color-s, --fa-primary-color-l.

The following JavaScript APIs have been removed: fontawesome.dom.i2svg(), fontawesome.dom.css(). Use fontawesome.dom.watch() as a replacement.

Having Issues?

If you encounter any issues during upgrade, refer to these resources:

Tip: You can paste multiple code blocks at once Reference
Share

Related