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

Fix overlapping max-width and min-width on media queries #2442

Merged
merged 1 commit into from
Jul 8, 2022

Conversation

Wanztwurst
Copy link
Contributor

The configured breakpoint is being used in the css media queries for the desktop (min-width: breakpoint) and mobile (max-width: breakpoint). This causes the queries to overlap at the exact breakpoint size, e.g. 700px, and being active at the same time.

These changes reduce the mobile breakpoint to (max-width: breakpoint-1), so that the set breakpoint represents the smallest width for the desktop layout.

@iRyusa
Copy link
Member

iRyusa commented Mar 16, 2022

I don't really get your issue as it was clearly intended to have those media queries to overlap here. Can you add some context ?

@Wanztwurst
Copy link
Contributor Author

I think it was made with the same value for min- and max-width out of convenience. Why would the rules for desktop and mobile apply both at the breakpoint? It's either desktop or mobile. The breakpoint being the width the mailing is created for I don't see why objects would already be supposed be displayed differently.

@iRyusa
Copy link
Member

iRyusa commented Mar 30, 2022 via email

@iRyusa
Copy link
Member

iRyusa commented Mar 30, 2022

Well I'm stupid.
As both media query are turned on at 480px (default breakpoint) it means that there's a mix of both version eg full width image is applied at 480px on desktop version. So that's a great change 👍

@@ -1,5 +1,5 @@
## mj-breakpoint
This tag allows you to control on which breakpoint the layout should go desktop/mobile.
This tag allows you to control on which breakpoint the layout should go desktop/mobile. At window widths below this value the layout will be displayed in mobile mode.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we should add this in the doc here as everyone should be familiar enough with media queries and what a breakpoint mean. Can you remove this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, if it's too verbose.

@iRyusa iRyusa merged commit 10cf28b into mjmlio:master Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants