Skip to content
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

'use the block API's style' warning for CSS loaded by 'admin_enqueue_scripts'. #37973

Closed
ddryo opened this issue Jan 14, 2022 · 1 comment
Closed
Labels
[Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed

Comments

@ddryo
Copy link
Contributor

ddryo commented Jan 14, 2022

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.

スクリーンショット 2022-01-14 16 05 36

This may be related to issue #34333.

I feel something like the following is needed.

  • 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

  1. Use the 'admin_enqueue_scripts' and 'enqueue_block_editor_assets' hooks to load the CSS.

  2. In the block editor, set the 'Preview' mode to 'Tablet' or 'Mobile

  3. 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

@aristath aristath added the [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed label Jan 14, 2022
@aristath
Copy link
Member

These warnings were already removed in #37937 and the change will be backported to WP5.9 👍
Closing this one as it has been resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed
Projects
None yet
Development

No branches or pull requests

2 participants