-
Anonymous
This is a follow-up to a related topic from before (Global Styles Media Query Customization), but I’m running into a new kind of problem.
I can successfully customize the default media queries for the new version 2 blocks in GenerateBlocks. However, if I use either
emorremunits instead ofpxto do the media queries, the responsive view menu on version 2 blocks breaks. I can click the buttons, but they do not resize the editor iframe.I do not see anything in the browser console that indicates an error when a responsive view button is clicked–it just doesn’t do anything.
Do you know what I can do to address this?
Thanks.
-
Hi there,
Sorry for the late response.
The current state of the WordPress editor window doesn’t allow full control over the responsive widths
So it cannot recognize non-pixel units or provide more granular sizes at this time, unfortunately! -
Anonymous
Ah, interesting.
Is there a way to have GeneratePress/Blocks use non-pixel units but not force the editor to try to adhere to those sizes/units? If it helps in investigating it, I have found that while the responsive views for the new version 2 blocks don’t work, if I have an old version 1 block on the same page, I can use the responsive view buttons on that block to change the editor size. And the version 2 blocks with the non-pixel units render correctly according to their non-pixel media query styles.
So I can keep a code snippet of an old version 1 block, switch to the code editor view, and paste it in. Then I can select that block and use the responsive controls if I want to switch the editor size. I’ve tested this, and it works. But it’s obviously a very annoying workaround.
Is there any other way to allow the editor to resize in this situation? I guess I basically need whatever way the old blocks use to trigger the responsive view sizes, because that does still work, even with my changes.
Thanks.
-
Hi there,
Version 2 should work like version 1 does, but in this case, it may not know what to do because of the unit you’re using.
We’re going to have to introduce a parsing system so we can set the editor width to the width that makes sense with any and all at rules. We currently do this, but obviously it’s only parsing
pxvalues.I’ve made a note of this so we can look at improving it in the next version of GB.
Thanks!
-
Anonymous
That would be great. Thanks!
- You must be logged in to reply to this topic.