-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editor styles are broken when a Google Font @import is included #53509
Comments
This also occurs when using an |
Howdy @andreiglingeanu and @cbirdsong, much appreciation for flagging the problem. I delved into it and successfully replicated it. This glitch might impact the editor styles on many sites. |
The issue stems from a bug in the CSS parsing library we used: It's feasible to reproduce this using:
For instance, on npm runkit: https://npm.runkit.com/css. Our task involves rectifying our local fork packages/block-editor/src/utils/transform-styles/ast/parse.js and submitting an upstream patch to ensure universal benefit from the fix. |
@jorgefilipecosta what can be done to move forward on this? This issue is labeled high priority but has sat for a number of months. The high priority label should be used for important items that need quick attention. To help ensure these issues are actionable, I'm doing a sweep and wanted to check in here to ensure we close this promptly whether that's with your PR or bringing in others to help resolve. |
@annezazu @jorgefilipecosta I'm unable to reproduce the error that @andreiglingeanu posted; i'm able to load the font in the editor as expected. (if I add the following to the css file enqueued by add_editor_style)
the heading block with h2 will use that font in the editor note, the new result is:
(I believe the that root selector appearing instead of editor-styles-wrapper is now intentional; cc @strarsis |
!! Amazing triaging and diving in @skorasaurus. I'm going to proactively remove the high priority label from now but keep in mind we can always add in back in as this updated convo unfolds. |
@skorasaurus I can re-validate the initial issue against the latest |
The CSS variables should also be isolated by adding
🤔 Interesting, IMHO that CSS parser code was basically developed internally, and therefore replaced by a proper library. |
I verified this issue was fixed with the merge of #49521. |
Description
When the editor style contains this line, it breaks the page entirely:
Step-by-step reproduction instructions
functions.php
Result:
Expected result:
Screenshots, screen recording, code snippet
This seems like a problem within the
block-editor/src/utils/transform-styles/transforms/wrap.js
file.Environment info
WordPress 6.3, a classic theme.
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: