-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
FSE script into iframe insertion needs to be less restrictive on how it determines whether to include a stylesheet #42509
Comments
Just want to clarify, the exact problem I was experiencing is also the result of my naming of the stylesheets themselves. either way you can't progress to that specific bug without including wp-block in your main stylesheet somewhere (i've just slapped it in with a dummy variable) ala: this pretty much circumvents the problem above, and not naming your enqueued assets with "css" somewhere in there also helps. |
Update: this is also failing to load custom third party stylesheets, like Google fonts or Typekit. Kinda pressing. |
Same here. Adobe Fonts/Typekit renders properly on the front-end. But the Block Editor ignores the enqueued CSS file across all browsers (Mac), and Network Inspector confirms no font files are loading. This plugin loads Typekit via API, which temporarily solved my issue. You can also load Typekit via JS as a potential workaround. |
Hi! The We've done lots of work in WP 6.3 to make sure that there are always ways to add stylesheets to the iframe without the compatibility script. Since #49655, you can use the |
Thanks for clarifying here. Switched to |
YESSS thank you! |
Description
In the Site Editor, Block CSS should be included without needing to use wp-block as a CSS selector in the built stylesheet, it should be included in the iframe by virtue of it being registered through enqueue_block_assets.
My suggestion would be to add to enqueue_block_assets a data-attr/some "block asset" identifier to just scan for instead, because whether or not the right selectors are in the stylesheet shouldn't be the sole criteria for including it in the FSE.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Specifically this section:
https://github.com/WordPress/gutenberg/blob/0a6a23b213c4fe9e3b337c8b71fa87bbf82c4496/packages/block-editor/src/components/iframe/index.js
Environment info
No response
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: