-
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
Block editor mobile preview iframes ignore add_theme_support( 'wp-block-styles' )
#39373
Comments
Not to pile on, but I'm also having this issue. One thing I can add is that it seems to be specific to Firefox as mobile and tablet previews continue to work for me in more recent Google Chrome browsers--but not so much in Firefox. |
Thanks for bumping this bug report. For me, the problem is across all browsers, at least both Firefox and Chrome. This screenshot is in Chrome ( These two screens are the exact same page in the editor. The mobile previews are pulling in opinionated block styles, but the desktop view does not. In this example, I do not ever want opinionated block styles pulled in. But, there seems to be no way to prevent that from happening in the iframed mobile previews. |
Hi @skorasaurus thanks for taking time to catalogue but I'm not sure |
Thanks for pinging me back @ALJ ; on second read of the question; I misunderstood what you originally wrote in your bug report and thought it was occurring while viewing the preview in a tablet ; that's clearly my fault. |
All good. Thanks for that! |
Thanks for the report; On second review of this; I am able to reproduce this bug; WP 5.9.3, gutenberg 12.9.0; firefox 99.0 (did not try in chrome) A hunch that this may be related to #33346? |
I'm not entirely sure what I'm experiencing is the same issue reported here, but I find the problem is happening regardless of whether or not I have I am finding that my theme CSS loads fine in the editor in Desktop mode, but not at all in Tablet or Mobile mode, and this is happening across browsers. (Tested in Safari, Chrome and Firefox on Mac.) This is a tangent, so I should probably open a separate ticket for it, but I think the labeling of the menu as "Preview" is misleading, which is how I became aware of this issue in the first place. My client sent me a long list of issues they were seeing with the site in tablet and mobile views, which confused me greatly until I realized they were using the Preview menu to switch the editor view, and thinking it was an actual page preview. Since it's not that, it shouldn't be called that. |
Same issue here. |
Description
The block editor allows themes to opt-in to slightly more opinionated styles for the front and editor by calling
add_theme_support( 'wp-block-styles' );
. This works as expected on the front end and in the block editor'sDesktop
mode.But, this does not work as expected in the block editor's iframed
Tablet
andMobile
preview modes. In the iframed previews, the opinionated styles are always loaded, regardless of thewp-block-styles
support of the theme.Step-by-step reproduction instructions
add_theme_support( 'wp-block-styles' );
, from the theme'sfunctions.php
file.Quote
block and fill with sample text.Quote
block lacks the visual left border. This is expected since we removedwp-block-styles
from the theme.Preview
>Tablet
to enter the iframe preview.Quote
block now has the visual left border because the preview iframe is loading/wp-includes/css/dist/block-library/theme.css
. This is unexpected since the preview iframe should not load that CSS file without adding theme support forwp-block-styles
.Screenshots, screen recording, code snippet
No response
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: