-
Notifications
You must be signed in to change notification settings - Fork 19
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
V6 Roadmap #42
Comments
We will wait with As @Antonio-Laguna already hinted at, we really like this package and appreciate that it is getting a major update! I recently started using This works fine for simple detection but quickly becomes a hassle and a specialised parser would be better. |
Would it be possible if the new version used inverted media queries to produce accurate conversions. Input: @media (width < 100px) postcss-preset-env output: @media (max-width: 99px) This is of course not accurate because it does not cover widths between 99px and 100px. However, there is a way to convert @media not all and (min-width: 100px) Source: https://ryanmulligan.dev/blog/invert-media-queries/ Have such inverted media queries been considered? |
@yisibl this might be interesting for this update (if the swc integration is more trouble than it's worth). In the end we found that a tokenizer is sufficient for now : csstools/postcss-plugins#627 The tokenizer hasn't been published yet and we hope to still create a parser for |
@yisibl The tokenizer and media query parser are now finished and I am converting this plugin as a way to validate those packages. Most things just work because nothing is regexp-based. I am unsure if you are still actively working on V6? Edit : This is pretty much done.
Only thing not done is improving support for the |
As more and more browsers support range syntax, the syntax of
@media
becomes complex and the current regular expression substitution pattern will become difficult to maintain.For example, the following rules are valid in browsers.
There are also new
@container
rules:So, consider a complete refactoring in the new version, adding a dedicated at rule parser to parse them. Perhaps a good place to start is to investigate css-tree in conjunction with PostCSS.
The
postcss-media-minmax
plugin is very popular, with over 6 million downloads per week. The refactoring will maintain better compatibility with browsers, which will be significant.Feel free to discuss, PR or sponsor!
Related packages
Spec issue
<mf-range>
"swapping value and name" syntax really useful? w3c/csswg-drafts#2791The text was updated successfully, but these errors were encountered: