csstools / postcss-normalize

Use the parts of normalize.css (or sanitize.css) you need from your browserslist
Creative Commons Zero v1.0 Universal
816 stars 40 forks source link

Added sass @use functionality. #48

Closed james-camilleri closed 3 years ago

james-camilleri commented 4 years ago

Updated the import regex to also handle sass's @use directive, as described in #47.

jonathantneal commented 4 years ago

This may create a secondary problem. CodePen uses PostCSS Use (it predates Sass’s use) to use plugins. AFAIK, the two systems are wholly incompatible, as they reached for the same namespace for completely different reasons. In my opinion, Sass has the advantage here, as they are a superset of CSS, whereas this one plugin is not making the same claim.

The problem, for me, is that I could introduce a feature that breaks a website like CodePen, because folks reach for @use and CodePen errors out because it’s not a valid plugin.

Use Plugin: https://github.com/postcss/postcss-use

james-camilleri commented 4 years ago

Oh no, I had no idea that a separate @use directive existed for postcss plugins. That is a problem. In addition, I've noticed that while the fix does allow for the plugin to be compatible with the new syntax, it ends up causing errors anyway because the CSS is actually injected before the SASS parser begins to process the stylesheets. This will require a different solution I believe. Thanks for the quick feedback though. :)

jonathantneal commented 3 years ago

Closing this with the resolution that it will require a different solution.