-
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
Responsive vw font sizes & query columns flex layout with em margins. Alternatives? #37330
Comments
I thought about defining a fixed font size for the Query Loop or Post Template, and then defining each inner block font size (Post Title, Excerpt, Post Author, Post Date etc) separately with the responsive global font size. This would fix the layout breaking issue, but neither the Query Loop or Post Template blocks have typography support in the editor. So how about wrapping the query in a Group block, and defining a fixed font size there? Well this also cannot be done because surprisingly the Group block also does not have typography support in the editor. |
Have you tried an approach like this? https://github.com/aristath/q/blob/7e034026b335fbd6659d1ad9413dad12313e7cc9/theme.json#L4-L56 |
That's really interesting, thank you. It still breaks the layout in Firefox because of the one instance of Replace the |
In case anyone wants to recreate the breaking layout, this is the very basic html page I created for testing with the same CSS that Gutenberg uses for the Query Loop. Resize the viewport slowly and notice the breaking layout in the firefox browser.
Guess I'm going about this the wrong way in attempting to find a fix at the block level, when it maybe needs addressing in mozilla/firefox?? |
The issue does not appear with an odd number of columns, only even e.g. 2 or 4 columns. The width of each post (2 columns) is defined like so: If this is rounded up e.g. Would this be something that could be given consideration to be adjusted in Gutenberg? |
It would be tricky to round up the This:
Could be changed to this:
|
Another possibility would be to use grid layout for the query loop columns instead of flex. For example:
With grid layout, the width and spacing is taken care of by the parent Also in testing I'm not seeing any layout conflicts with |
Hey @Andrew-Starr - looping back to this older issue - do you still see this present when testing in Firefox? |
Hi @jordesign The issue seems to be mostly fixed in the latest Firefox release. Using the font size examples above no longer presents an issue in my testing. Using However, something with a bit more of a mix of units such as |
What problem does this address?
In an attempt to provide responsive font sizes, I've noticed that using viewport width
vw
breaks the layout of the Query Loop columns in the Firefox browser.Video here: #37295 (comment)
Examples of font sizes I have tried:
and many other variations each with a
vw
value, all break the query columns layout.What is your proposed solution?
I don't have a definite solution.
Grid layout for the query loop?
Alternative to
vw
for providing responsive font sizes?Would love to hear some alternative solutions.
The text was updated successfully, but these errors were encountered: