You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CSS that is not for a specific block but for the UI of the admin and editor are loaded using the 'admin_enqueue_scripts' and 'enqueue_block_editor_assets' hooks.
Then, when the device preview is toggled or the block style preview is opened, those CSS are loaded in the <iframe>, and the "use the block API's style" warning appears as shown below.
Stop loading these CSS into the iframe and create a more suitable hook that will load the CSS into the iframe.
Or, I think you need to implement a way to detect loading in an iframe within the 'admin_enqueue_scripts' hook. (If there is one already, please let me know, I can't detect it with IFRAME_REQUEST)
Step-by-step reproduction instructions
Use the 'admin_enqueue_scripts' and 'enqueue_block_editor_assets' hooks to load the CSS.
In the block editor, set the 'Preview' mode to 'Tablet' or 'Mobile
Then you will see a warning in the console.
Environment info
WordPress 5.9-RC2
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:
Description
CSS that is not for a specific block but for the UI of the admin and editor are loaded using the
'admin_enqueue_scripts'
and'enqueue_block_editor_assets'
hooks.Then, when the device preview is toggled or the block style preview is opened, those CSS are loaded in the
<iframe>
, and the "use the block API's style" warning appears as shown below.This may be related to issue #34333.
I feel something like the following is needed.
iframe
.iframe
within the'admin_enqueue_scripts'
hook. (If there is one already, please let me know, I can't detect it withIFRAME_REQUEST
)Step-by-step reproduction instructions
Use the 'admin_enqueue_scripts' and 'enqueue_block_editor_assets' hooks to load the CSS.
In the block editor, set the 'Preview' mode to 'Tablet' or 'Mobile
Then you will see a warning in the console.
Environment info
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: