Closed inomn closed 2 years ago
Hi! I'm trying to migrate from SASS to PostCSS, and currently facing an issue with media queries.
// media.pcss
$media-m: "min-width: 600px";
// button.pcss
.root { @media ($media-m) { color: red; } }
Output CSS file
@media ("min-width: 600px") { .root { width: 200px; color: red; } }
The issue here is " around the media query rule and also WebStorm is not happy about this syntax
"
Any suggestions on how to fix this issue? Thanks in advance!
p.s. my plugins chain:
'postcss-simple-vars' 'postcss-calc' 'postcss-custom-media' 'postcss-mixins' 'postcss-nested-ancestors' 'postcss-atroot' 'postcss-current-selector' 'postcss-nested' 'postcss-mixins' 'autoprefixer' 'postcss-flexbugs-fixe 'postcss-easy-import'
This syntax is non-standard. This is why WebStorm CSS linter print you an warning.
I recommend using CSS Custom Media from postcss-preset-env https://preset-env.cssdb.org/features/#custom-media-queries
postcss-preset-env
Hi! I'm trying to migrate from SASS to PostCSS, and currently facing an issue with media queries.
// media.pcss
// button.pcss
Output CSS file
The issue here is
"
around the media query rule and also WebStorm is not happy about this syntaxAny suggestions on how to fix this issue? Thanks in advance!
p.s. my plugins chain: