Skip to content

Fix Font Awesome 6 loading Font Awesome 5 glyphs (blank X/Twitter icon) - #350

Merged
puikinsh merged 2 commits into
masterfrom
fix/fontawesome6-webfont-path
Aug 11, 2026
Merged

Fix Font Awesome 6 loading Font Awesome 5 glyphs (blank X/Twitter icon)#350
puikinsh merged 2 commits into
masterfrom
fix/fontawesome6-webfont-path

Conversation

@puikinsh

Copy link
Copy Markdown
Member

Folded into the unreleased 1.2.21.

The blank X (Twitter) icon

Reported on the demo: the footer social row showed a gap where X should be.

Everything looked right — <i class="fa-brands fa-x-twitter">, the rule
.fa-x-twitter:before{content:"\e61b"}, and assets/css/fontawesome6/webfonts/fa-brands-400.woff2
genuinely contains U+E61B (verified with fontTools: 576 codepoints, "Font Awesome version: 6.4.2").

The browser was never given that file. all.min.css referenced its fonts as
../webfonts/, which from assets/css/fontawesome6/ resolves out to
assets/css/webfonts/ — a Font Awesome 5.15.3 set (462 codepoints) left
behind by an earlier upgrade. The live demo requested:

/themes/shapely/assets/css/webfonts/fa-brands-400.woff2

and never requested the fontawesome6 copy at all.

Measured rendered ink in the browser, before:

glyph ink px
facebook-f 548
linkedin-in 721
youtube 1249
instagram 759
twitter bird (retired, in FA5) 894
x-twitter 0

So every icon whose codepoint already existed in 5.15.3 worked by coincidence.
Anything added later was blank — fa-x-twitter and fa-section today, and
silently any FA6 icon added in future.

After: x-twitter 615, threads 701.

Changes

  • 20 url() references now point at webfonts/, keeping the 6.4.2 directory self-contained.
  • Removed the orphaned Font Awesome 5 files — nothing referenced them once the path was fixed. Zip: 3.16 MB → 1.88 MB.
  • The stylesheet is now versioned with SHAPELY_VERSION instead of the literal '6.4.2'.

That last one mattered more than it looks. The asset is served
cache-control: public, max-age=31536000, immutable, and ?ver=6.4.2 never
changes when the file does — so deploying the corrected path to the demo changed
nothing until the version string moved. A constant $ver on a mutable file is a
year-long lock on every edge and returning browser.

Verified on the live demo

Deployed to https://colorlibhub.com/shapely/ and re-checked: all five social
icons render, 5/5 pages pass with 0 blank icons, 0 broken images, 0 JS errors.

puikinsh and others added 2 commits August 11, 2026 11:16
…5 set

The X (Twitter) icon in the footer social links rendered as a blank gap. The
markup and the CSS were both correct -- <i class="fa-brands fa-x-twitter"> and
.fa-x-twitter:before{content:"\e61b"} -- and assets/css/fontawesome6/webfonts/
does contain U+E61B. The browser was simply never given that file.

assets/css/fontawesome6/all.min.css referenced its fonts as "../webfonts/".
From assets/css/fontawesome6/ that resolves to assets/css/webfonts/, which held
a Font Awesome *5.15.3* set left behind by an earlier upgrade. Confirmed on the
live demo, which requested:

    /themes/shapely/assets/css/webfonts/fa-brands-400.woff2

with no request for the fontawesome6 copy at all. Measuring rendered ink in the
browser: facebook-f 548 px, linkedin-in 721, youtube 1249, instagram 759, the
retired twitter bird 894 -- and x-twitter 0.

So every icon whose codepoint already existed in 5.15.3 worked by coincidence,
and anything added afterwards was blank. In this theme that is fa-x-twitter and
fa-section; it would silently affect any FA6 icon added later too.

The 20 url() references now point at webfonts/, keeping the Font Awesome 6 6.4.2
directory self-contained. With the path corrected nothing referenced the old
Font Awesome 5 files at all, so they are removed: the release zip goes from
3.16 MB to 1.88 MB.

Folded into 1.2.21 rather than a new version, as 1.2.21 has not been published
to WordPress.org yet.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…isitors

The enqueue passed Font Awesome's own '6.4.2' as $ver, so the URL is a constant
even when the file behind it changes. Combined with the cache-control this asset
is served under, that is a year-long lock:

    cache-control: public, max-age=31536000, immutable
    cf-cache-status: HIT

Deploying the corrected webfont path to the demo changed nothing for exactly
this reason -- the origin served webfonts/, and every edge and returning browser
kept serving ../webfonts/ from the immutable copy.

SHAPELY_VERSION changes on each release, which is precisely when the bundled
file can have changed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@puikinsh
puikinsh merged commit 6ed5df4 into master Aug 11, 2026
10 checks passed
@puikinsh
puikinsh deleted the fix/fontawesome6-webfont-path branch August 11, 2026 08:19
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

Successfully merging this pull request may close these issues.

1 participant