-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Mobile/Tablet/Desktop Previews do not work with externally loaded CSS #21193
Comments
Yes, this will be fixed with an iframe. The PR is almost ready. |
Hello. Media queries written in style sheets loaded by themes and plugins also do not work. I'm using the |
Also, it would be nice to have a way to detect from CSS which device mode is currently being previewed. It would be very helpful if something like the For example, just like turning on fullscreen mode gives it the It is possible to adjust the style using those class names. |
I was opening an issue for that. It would be also nice to have an hook / event for it. |
this one was fixed in gutenberg |
I believe we're still seeing this issue in wordpress.com. Was this a recent fix that hasn't been released yet? To reproduce:
Expected result (works correctly when running off localhost with wp-env, or off sandbox):
Actual result (wpcom):
|
Any update on this? Styling Gutenberg editor is really frustrating at this point. |
We need the iframe the post editor. I need to look at this again, but honestly is a tough and frustrating job :) The iframe has landed in the side editor, so there's some light at the end of the tunnel. I'll resume work on this. |
@ellatrix If there is anything that can be done to support your efforts on that front let us know :) It is a great effort but I can only imaging how frustrating it must be... :) |
Should be fixed by #33342. We're planning for all previews to be iframed in the WP 5.9 release. The only thing that will remain without an iframe is the post editor without (or "Desktop") preview. This is to give plugin and theme authors time to check their blocks and update them if needed. This particular issue should be resolved though, because it's about the Tablet and Mobile previews. |
So it have been a while and we have 5.9 ;) Does it's possible to enable iframe preview for Desktop too? I see it's not default, but maybe as an option somehow? |
same question here is there any option to force iframe preview for desktop? thanks! @ellatrix |
Same question here. |
Fixed by #48286 |
Describe the bug
On wordpress.com we use stylesheets loaded from
s0.wp.com
,s1.wp.com
for various plugins such as full-site-editing.When we install the gutenberg plugin and use the mobile preview, some of the css still behaves as if in desktop mode, so we see columns on mobile preview etc.
To reproduce
Steps to reproduce the behavior:
full-site-editing
plugin)Expected behavior
The columns should be stacked for mobile display. Preview should render as if in a mobile device.
Additional context
From our initial investigation, here is what appears to be happening:
Our current understanding of what's happening:
Mobile/tablet preview uses the
use-simulated-media-query
function which works by modifying the loaded stylesheets to simulate being viewed on mobile/tablet breakpoints.This works for stylesheets loaded from the same domain. However, on
wordpress.com
, the static domainss0.wp.com
ands1.wp.com
are used to serve many stylesheets such as those from thefull-site-editing-plugin
.These stylesheets are therefore rendered in desktop mode even when using mobile/tablet preview.
calypso issue: Automattic/wp-calypso#40401
The text was updated successfully, but these errors were encountered: