fix: ensure editor fonts and widths are loaded in iframed editor#2649
fix: ensure editor fonts and widths are loaded in iframed editor#2649laurelfulford merged 5 commits intotrunkfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Newspack theme’s block editor styling integration to keep custom fonts/colors and template-based editor widths working when the Gutenberg editor canvas is rendered inside an iframe (WP 7.0 behavior).
Changes:
- Switches editor style enqueues from
enqueue_block_editor_assetstoenqueue_block_assets(with anis_admin()guard) so styles load for the iframe canvas. - Implements an iframe workaround by prefixing custom editor body classes with
admin-color-, and updates editor override selectors to match. - Adjusts editor base styling to set
box-sizing: border-boxon.wp-block.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
newspack-theme/functions.php |
Moves editor style enqueues to enqueue_block_assets, versions them with theme version, and adds admin-color-* body class workaround for iframe editor. |
newspack-theme/sass/style-editor-overrides.scss |
Updates body-class-based selectors to the new admin-color-newspack-* class names for width/layout overrides. |
newspack-theme/sass/style-editor-base.scss |
Adds box-sizing: border-box to .wp-block to improve editor layout consistency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
Hey @laurelfulford, good job getting this PR merged! 🎉 Now, the Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label. If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label. Thank you! ❤️ |
# [2.20.0-alpha.1](v2.19.0...v2.20.0-alpha.1) (2026-03-19) ### Bug Fixes * **block-theme:** migrate newspack-theme modal checkout fixes ([#2648](#2648)) ([e4f9d91](e4f9d91)) * default pullquote borders ([#2630](#2630)) ([5eb0b76](5eb0b76)) * ensure editor fonts and widths are loaded in iframed editor ([#2649](#2649)) ([f49912e](f49912e)) * tweak subtitle to work with iframe editor ([#2650](#2650)) ([86d4193](86d4193)) ### Features * add an avatar size control for author bios ([#2647](#2647)) ([ccfb6b4](ccfb6b4))
|
🎉 This PR is included in version 2.20.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
# [2.20.0](v2.19.0...v2.20.0) (2026-03-30) ### Bug Fixes * **block-theme:** migrate newspack-theme modal checkout fixes ([#2648](#2648)) ([e4f9d91](e4f9d91)) * default pullquote borders ([#2630](#2630)) ([5eb0b76](5eb0b76)) * ensure editor fonts and widths are loaded in iframed editor ([#2649](#2649)) ([f49912e](f49912e)) * tweak subtitle to work with iframe editor ([#2650](#2650)) ([86d4193](86d4193)) ### Features * add an avatar size control for author bios ([#2647](#2647)) ([ccfb6b4](ccfb6b4))
|
🎉 This PR is included in version 2.20.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
In WordPress 7.0, the Gutenberg editor will always load in an iframe. This breaks our theme's font customizations, and also makes it so the body classes we need to change the editor width aren't loaded.
This PR takes a swing at fixing that by:
How to test the changes in this Pull Request:
npm run build.Other information: