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

Bug?: Unified media queries #613

Open
frzsombor opened this issue Jun 10, 2024 · 1 comment
Open

Bug?: Unified media queries #613

frzsombor opened this issue Jun 10, 2024 · 1 comment
Labels
feature Features, refactoring, enhancements, improvements triage Awaiting review

Comments

@frzsombor
Copy link
Contributor

frzsombor commented Jun 10, 2024

Description

Today I realised that GeneratePress and GenerateBlock are using different media queries for mobile/tablet breakpoint by default.

GeneratePress defaults GenerateBlocks defaults
Mobile: 0-768
Tablet: 769-1024
Desktop: 1025-∞
Mobile: 0-767
Tablet: 768-1024
Desktop: 1025-∞

Because of this, between 767px-769px, different parts of my website starts behaving unexpectedly and it bothers me. I've tried using the undocumented media query filters for overriding GeneratePress media queries to match GenerateBlocks, but found that not everything is affected by this filter. For example this part is hardcoded: assets/css/main.css#L1566-L1652

I think GP should follow GB's breakpoints everywhere (as those are more conventional) or at least media query filters should affect all media queries of GP. I can think of many different solutions, but I'm only started working with GP&GB for a week, so I don't fully understand how it works yet.

As the generate_media_queries filter is undocumented, I'm submitting this issue as a feature request, instead of a bug, however I think GP and GB using different breakpoints could be easily considered a bug.


References

https://github.com/tomusborne/generatepress/blob/3.4.0/inc/theme-functions.php#L356-L374
https://github.com/tomusborne/generateblocks/blob/1.9.1/includes/functions.php#L186-L197

@frzsombor frzsombor added the feature Features, refactoring, enhancements, improvements label Jun 10, 2024
@github-actions github-actions bot added the triage Awaiting review label Jun 10, 2024
@frzsombor
Copy link
Contributor Author

frzsombor commented Jun 10, 2024

UPDATE:
Ok, now I actually think that this is a bug 👾. I've searched all assets/css files for 767px and 768px and I can see that 768px is sometimes used inconsistently as the max for mobile (for example here), and many times correctly as the starting point for tablet (for example here). Updated the CSS files and now the breakpoints are beautifully consistent. Added a PR.

@frzsombor frzsombor changed the title Unified media queries [bug?] Unified media queries Jun 10, 2024
@frzsombor frzsombor changed the title [bug?] Unified media queries Bug?: Unified media queries Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Features, refactoring, enhancements, improvements triage Awaiting review
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant