Closed
Description
Style groups for mobile devices (max-width) are specified in the wrong order.
In lib/web/css/source/lib/_responsive.less
the style groups run breakpoint-size ascending: 319px, 479px, 639px, 767px, which leads to outputting max-width media queries breakpoint-size ascending - the last-defined breakpoint overrides smaller screen size breakpoints...
Preconditions
Magento 2.2
Steps to reproduce
Specify styles referencing max media widths
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__xs) {
.logo {
max-width: 165px;
}
}
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) {
.logo {
max-width: 140px;
}
}
Expected result
CSS should be output as follows:
@media only screen and (max-width: 639px) {
.logo {
max-width: 165px;
}
}
@media only screen and (max-width: 479px) {
.logo {
max-width: 140px;
}
}
Actual result
CSS is output as follows:
@media only screen and (max-width: 479px) {
.logo {
max-width: 140px;
}
}
@media only screen and (max-width: 639px) {
.logo {
max-width: 165px;
}
}
The last-defined breakpoint takes precedence over the 479px breakpoint even at screen sizes <= 479px.
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.1 release lineThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.3 release lineGate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 release