Skip to content

Fix - Redundant Font Awesome stylesheets loaded on every page - #120

Merged
iamprazol merged 3 commits into
developfrom
fix/21-redundant-font-awesome-css
Sep 30, 2026
Merged

iamprazol merged 3 commits into
developfrom
fix/21-redundant-font-awesome-css

Conversation

@rajatgautam755421

Copy link
Copy Markdown

Summary

  • css/all.min.css already ships its own complete, byte-identical copy of every rule and @font-face declaration in css/solid.min.css, css/regular.min.css and css/brands.min.css — verified by diffing every individual rule block between the files, not just class names.
  • Those three stylesheets were pure duplicate HTTP requests; removed them from the $font_awesome_styles enqueue array in flash_scripts(). css/v4-shims.min.css stays, since it's the only file providing the .fa.fa-iconname compound selectors the theme's markup (e.g. <i class="fa fa-search">) actually depends on.
  • Font downloads are unaffected — all.min.css's own @font-face rules already triggered the same .woff2 requests regardless of the other three files.

Companion to themegrill/flash-pro#21 and themegrill/flash-pro#134 (issue is tracked in flash-pro since it applies to both themes).

Test plan

  • Diffed every rule block (.fa-*{...}) in solid/regular/brands.min.css against all.min.css — zero unique rules in any of the three.
  • Grepped the full repo for any other reference to the removed style handles or files — none found.
  • Confirmed byte-identical (MD5) Font Awesome bundles between Flash and Flash Pro.
  • Live-verified on a local install: only all.min.css + v4-shims.min.css now request, zero console errors, icons render correctly.
  • Added a Playwright regression spec asserting the 3 stylesheets are never requested and the header search icon still renders a glyph; confirmed it fails against the pre-fix code and passes against the fix.
  • Ran full tests/e2e/specs/homepage/** suite; php -l clean.

🤖 Generated with Claude Code

all.min.css already ships its own complete, byte-identical copy of every
rule and @font-face declaration that solid.min.css, regular.min.css and
brands.min.css contain, so those three stylesheets were pure duplicate
HTTP requests. v4-shims.min.css stays enqueued since it provides the
.fa.fa-iconname compound selectors the theme's markup actually uses,
which all.min.css does not.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Update the regression test to cover unminified stylesheet URLs when SCRIPT_DEBUG is enabled.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Removes redundant Font Awesome stylesheet enqueues while preserving required icon support and adding regression coverage.

Changes:

  • Removes Solid, Regular, and Brands stylesheet registrations.
  • Retains all.min.css and v4-shims.min.css.
  • Adds request and search-icon rendering checks.
File Description
tests/​e2e/​specs/​homepage/​front-page-health.spec.ts Verifies redundant stylesheet requests are absent and the search icon renders.
functions.php Removes duplicate Font Awesome stylesheet enqueues.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/e2e/specs/homepage/front-page-health.spec.ts Outdated
@github-actions

Copy link
Copy Markdown

QA suite — passed ✅

All 18 checks passed.

12 passed · 0 failed · 6 skipped · 0 flaky · 34s

Automated check — no AI involved. It runs the tests in this branch.

@rajatgautam755421 rajatgautam755421 self-assigned this Sep 29, 2026
The matcher required a literal .min.css suffix, so on a SCRIPT_DEBUG
install (flash_scripts() drops the .min suffix) the spec would record
no Font Awesome requests at all and fail even when the enqueue is
correct. Made the .min segment optional so both paths are covered.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@deepench deepench left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@iamprazol iamprazol left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !! 👍

…ont-awesome-css

# Conflicts:
#	tests/e2e/specs/homepage/front-page-health.spec.ts
@iamprazol
iamprazol merged commit aaf97eb into develop Sep 30, 2026
1 check failed
@iamprazol
iamprazol deleted the fix/21-redundant-font-awesome-css branch September 30, 2026 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants