[2.x] feat: upgrade FontAwesome from 6.x to 7.x#4388
Merged
Conversation
Switches the Composer dependency from the unmaintained `components/font-awesome` shim (capped at 6.5.2) to the canonical `fortawesome/font-awesome` package at ^7.0 (currently 7.2.0). FA7 ships .woff2 only (no ttf/woff/eot), keeps identical CSS filenames (fontawesome.css, solid.css, regular.css, brands.css), identical ../webfonts/ url() paths, and retains the .fas/.far/.fab shorthand aliases — so zero changes are required to LESS imports, LessCompiler URL rewriting, icon class strings in JS, or any Theme extender customisation surfaces. Changes: - framework/core/composer.json: fortawesome/font-awesome ^7.0 - FrontendServiceProvider: LESS import dir → fortawesome/font-awesome/css - PublishAssets: webfonts source → fortawesome/font-awesome/webfonts - AssetsPublishCommand: webfonts source → fortawesome/font-awesome/webfonts - Add PublishAssetsTest unit tests (previously untested) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Update CDN placeholder URL from FA 6.5.2 to 7.2.0 - Update app.refs.fontawesome link from /v6/icons to /icons (version-agnostic) - Add icon preview area to the FontAwesome section of the Advanced page showing three tiers: FA5/FA6 aliases, FA7 class names (including one FA7-only icon: fa-bus-side), and Pro-only styles (Light/Thin/Duotone) so admins can visually verify their local/CDN/Kit setup at a glance - Add FontAwesomePreview LESS styles to AdvancedPage.less - Add locale strings for preview labels Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace flat row layout with per-tier cards (--control-bg background) - Add uppercase section headers with a hairline divider - Larger tiles (44px) with label underneath each icon - Hover state: primary-color border + subtle ring - Tooltip on tile shows the full CSS class string Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…state fade() cannot operate on CSS custom properties. Replace with a --control-bg-shaded box-shadow ring which works with the LESS compiler. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the inline preview section on the Advanced page with a "Preview Icons" button that lazy-loads FontAwesomePreviewModal on click. The modal is only downloaded when needed, keeping the Advanced page compact. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Without this, async chunks emitted into js/dist/admin/ (such as the FontAwesomePreviewModal chunk) are never registered with the asset server and return 404 when dynamically imported. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The .Select span wrapper was display:inline-block which caused it to shrink-wrap to content width even inside a FormSection column. Added a .FormSection & rule to make it display:block and width:100%, consistent with the existing rule that already set width:100% on the inner <select> element. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…yles The existing help text only showed the legacy 'fas fa-' prefix. Updated to show both the legacy shorthand (fas fa-flag) and the FA7 canonical form (fa-solid fa-flag) as examples. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
imorland
added a commit
to flarum/docs
that referenced
this pull request
Feb 25, 2026
- Add dedicated FontAwesome page covering Local/CDN/Kit sources, icon class name reference, renamed icons table, and extension dev notes - Add FontAwesome page to Management sidebar - Update config.md: prose and CDN example URL to FA7 - Update themes.md: version reference and link to new FA page - Update extend/i18n.md: replace dead fortawesome.github.io URL - Update extend/update-2_0.md: add FontAwesome 5→7 upgrade section under Backend > Dependencies Relates to flarum/framework#4388 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades the bundled FontAwesome library from Free 6.5.2 (via the unmaintained
components/font-awesomemirror) to Free 7.x (via the officialfortawesome/font-awesomeComposer package). Fully backward-compatible — all existingfas/far/fabclass names continue to work via FA7's shipped CSS aliases.Also adds FontAwesome source configuration (Local / CDN / Kit) to the admin Advanced page, with a lazy-loaded icon preview modal, and fixes a pre-existing gap where the admin
jsDirectorywas never registered (preventing async admin chunks from being served).Changes
Backend
composer.json—components/font-awesome: ^6.5.2→fortawesome/font-awesome: ^7.0FrontendServiceProvider.php— updated vendor path for LESS importPublishAssets.php— updated vendor path for webfont publishingAssetsPublishCommand.php— updated vendor path for assets:publish commandAdminServiceProvider.php— registered missingjsDirectoryso async admin chunks are served correctlyFrontend
Application.tsx— updatedapp.refs.fontawesomeURL to version-agnosticfontawesome.com/iconsSelect.less— fixed.Selectwrapper not stretching to full width inside aFormSectioncolumncore.yml— updatedicon_texthelp string to show both FA5/6 (fas fa-flag) and FA7 (fa-solid fa-flag) prefix stylesTests
PublishAssetsTestunit tests (previously untested): verifies correct vendor path, file copying, revert behaviour, and woff2-only output from FA7Backward Compatibility
fas,far,fabshorthand aliases are explicitly defined in FA7's CSS — no icon references in extensions need to change@import (inline)on the pre-built CSS;url("../webfonts/")paths are identical in FA7.woff2only (no.eot,.ttf,.woff,.svg) — all modern browsers support WOFF2Upgrade Notes for Existing Installs
After upgrading, old font files in
public/assets/fonts/are not automatically removed. Admins should run:Docs PR: flarum/docs#501
Test plan
public/assets/fonts/contains only.woff2filesconfig.phpoverride for each source disables the admin UI inputsfas fa-bus-side) renders correctlyfas fa-cogetc. still render (alias compatibility)php flarum assets:publishon an upgraded install, verify stale FA6 files are removed after manual clear🤖 Generated with Claude Code