-
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
@custom-media directive fails #2639
Comments
If you don't want CSS to be parsed use You can make a feature-request to support Aside of above notice that you're actually trying to use wrong css file. The [``/src/css/flexboxgrid.css |
I see, I thought it was already part of the spec. I guess this would be part of a wider discussion on when LESS should support newer CSS features - custom media is part of this draft spec. |
IMO Less will support features when they are implemented in more than one major browser, which I believe is along the same guidelines the W3C uses from moving something from Candidate Recommendation to Recommended status. However, this is a gray area, because technically, in CSS, you can write any @-rule you want, and if the browser doesn't support it, it simply ignores it. Less doesn't really currently lint properties to test if they're valid, so explicitly passing only certain at rules is a little inconsistent but probably pragmatically necessary. Ideally though, if Less was going to act as a linter, it would simply check to see that CSS statements were correctly constructed, and that Less statements were valid. So, I would support simply allowing any @-rule that passes the CSS syntax rules for valid construction of an @-rule, just like we do with blocks and parameters / values (unless @seven-phases-max or @lukeapage is like "Do you know how complicated that will make our parser?"). |
This makes sense. Actually currently Less does pass any unknown at-rule followed by |
Another reason why Less should be a PostCSS plugin. |
@stevenvachon Making Less a PostCSS plugin would not change anything except parsing. The rules would still need to be evaluated by Less. |
No time; I have other projects. Less shouldn't have plugins as we already have PostCSS. I'm pretty sure that literal("@custom-media --md-viewport only screen and (min-width: 62em);"); |
There're already But note that the main problem of that particular example is not that Less can't parse it - but in inability of Less to "bubble" this statement out of the wrapping |
Correct. This is what I was saying. PostCSS doesn't solve anything without a preprocessing plugin to evaluate it (or "transform it" as PostCSS calls it). Even the author of PostCSS specifies that all that PostCSS technically is just a parser which creates an AST. That said, I'm "working on" a postcss-less plugin. I say it in quotes because it depends on having extra time. |
Once many CSS features are implemented in the browsers, you guys will have to implement them in Less. They're already available as plugins for PostCSS, so it'd be less work for you and less waiting for us in the future.
|
I think I'll merge this to #2770 (this one is earlier but to not bother with label reassigning). |
Merged to #2770. |
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. |
Input LESS
Output CSS
How do I namespace CSS imports? Casting this file to less doesn't work as it uses newer CSS features. e.g.:
@custom-media --md-viewport only screen and (min-width: 62em);
The text was updated successfully, but these errors were encountered: