-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Invalid nested media query merge with "or" condition, when a variable is used for sub-media query #2964
Comments
This is more a feature request than a bug. Less is not supposed to understand what is inside those Technically, the code like above ("list of media queries in an escaped string") is more like an old quirk/syntax-workaround rather than ever considered proper code (yet again because of .highdpi(@rules) {
@media (-webkit-min-device-pixel-ratio: 1.25),
(min-device-pixel-ratio: 1.25),
(min-resolution: 1.25dppx) {
@rules();
}
}
.bg {
@media (max-width: 1000px) {
background: url(bg-small.png);
.highdpi({
background: url([email protected]);
});
}
} or similar methods. Related to #1421 and similar issues/requests. Note that even as a feature request (if proposed) this feature will have to use different syntax instead of Merging to #1421 maybe? |
@seven-phases-max thank you for clearing this up. I'm going to change my mixin to utilize another ".highdpi" mixin instead of the variable with escaped string. |
@seven-phases-max I think there are two separate issues / feature requests here, so not sure if we should merge to #1421 without specifying those.
|
Referencing #3059 here, since essentially it's almost the same problem. I.e. basically the question is: "Can we afford full featured reparsing of |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Invalid media query is compiled when using a variable containing a media query definition with OR conditions (either with comma or "or"-keyword). Top media query should be prepended to each sub-query.
Less:
Output:
Expected output - "(max-width: 1000px) and " before each comma-separated part:
On the other hand, it compiles fine, when not using a variable:
The text was updated successfully, but these errors were encountered: