Fix - Editor Google Fonts request returns HTTP 400 and never reaches the block editor - #71
Open
rajatgautam755421 wants to merge 2 commits into
Open
rajatgautam755421 wants to merge 2 commits into
rajatgautam755421 wants to merge 2 commits into
Conversation
…the block editor (themegrill/radiate-pro#63) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
QA suite — passed ✅All 12 checks passed. 8 passed · 0 failed · 4 skipped · 0 flaky · 16s Automated check — no AI involved. It runs the tests in this branch. |
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The font rules remain in the parent admin document and may not style the editor iframe; the editor stylesheet needs an iframe-capable enqueue path.
Review effort: Lite
Findings: None
What changed in this PR
Fixes Google Fonts loading in the block editor by correcting the CSS2 URL and enqueueing fonts for the editor iframe.
Changes:
- Adds editor-only Merriweather and Roboto loading.
- Adds an end-to-end regression test.
- Registers the
block-editorQA area.
| File | Summary |
|---|---|
functions.php |
Corrects editor font loading. |
tests/e2e/specs/block-editor/editor-fonts.spec.ts |
Tests the iframe font stylesheet. |
.themegrill-qa/suite.json |
Registers block-editor coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…o it reaches the iframe (themegrill/radiate-pro#63) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Closes themegrill/radiate-pro#63
Fixes the editor part of themegrill/radiate-pro#63 (Free).
Two problems made the block editor lose the theme fonts:
radiate_block_editor_styles()asked forcss2?family=Roboto|Merriweather:400,300. Thecss2endpoint does not accept that old syntax, so Google answers HTTP 400 and the browser blocks the response.enqueue_block_editor_assetsdo not reach the block editor iframe, so the fonts still would not apply to the editor text. (Spacious Pro and Zakra document and handle the same thing.)The fonts stylesheet is now enqueued on
enqueue_block_assets(admin only) with a valid CSS2 URL:https://, no&ver=, and the weights the front end already loads (Merriweather 300/400, Roboto 400).Test
fonts.googleapis: the request is now 200 (before: 400). The editor text uses Roboto and Merriweather (before: generic fonts).Adds a
@freshspec and ablock-editorarea in the suite manifest: it fails ondevelop, passes 3/3. Full suite: 11 passed, 5 skipped. PHPCS unchanged (8 errors, 4 warnings both sides). Remote fonts on every page (part 2 of the issue) is not touched.Changelog: Fix - Editor fonts now load inside the block editor canvas.