MoOx / postcss-cssnext

`postcss-cssnext` has been deprecated in favor of `postcss-preset-env`.
https://moox.io/blog/deprecating-cssnext/
MIT License
5.3k stars 188 forks source link

unexpected custom media behavior #437

Closed v1z closed 6 years ago

v1z commented 6 years ago

If I declare my custom media for retina as @custom-media --retina (min-resolution: 192dpi) and (-webkit-min-device-pixel-ratio: 2); in output css it would be @media (-webkit-min-device-pixel-ratio: 2) and (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) and (-webkit-min-device-pixel-ratio: 2)

First part of generated rule breaks the second's part logic, doesn't it?

Semigradsky commented 6 years ago

This is autoprefixer problem. Just no write redundant -webkit-min-device-pixel-ratio: 2:

@custom-media --retina (min-resolution: 192dpi)
Semigradsky commented 6 years ago

If you no want modify your code, you can clean prefixes before run postcss. See https://github.com/postcss/autoprefixer#outdated-prefixes