Fix - Redundant Font Awesome stylesheets loaded on every page - #120
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Update the regression test to cover unminified stylesheet URLs when SCRIPT_DEBUG is enabled.
Review effort: Lite
Findings: 1
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.cssandv4-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.
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. |
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>
…ont-awesome-css # Conflicts: # tests/e2e/specs/homepage/front-page-health.spec.ts
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
css/all.min.cssalready ships its own complete, byte-identical copy of every rule and@font-facedeclaration incss/solid.min.css,css/regular.min.cssandcss/brands.min.css— verified by diffing every individual rule block between the files, not just class names.$font_awesome_stylesenqueue array inflash_scripts().css/v4-shims.min.cssstays, since it's the only file providing the.fa.fa-iconnamecompound selectors the theme's markup (e.g.<i class="fa fa-search">) actually depends on.all.min.css's own@font-facerules already triggered the same.woff2requests 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
.fa-*{...}) insolid/regular/brands.min.cssagainstall.min.css— zero unique rules in any of the three.all.min.css+v4-shims.min.cssnow request, zero console errors, icons render correctly.tests/e2e/specs/homepage/**suite;php -lclean.🤖 Generated with Claude Code