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

Custom Import breaks SCSS imports #31

Closed JamiesonRoberts closed 5 years ago

JamiesonRoberts commented 6 years ago

In the past I've loved using your plugin for this, but I'm currently running into an issue (specifically in this case with laraval mix, but would apply to any precompiled versions of CSS) where the custom import declaration breaks builds for SASS/SCSS due to the fact that its not recognizing the import signature.

I get that its a postCSS tool, but there are lots of people who use PostCSS in conjunction with other formats of CSS processing. Thoughts on how to make it so that it works not only in the PostCSS landscape, but also with other precompiled formats?

JamiesonRoberts commented 6 years ago

NOTE: I do recognize that there is the force import option, but as you probably realized in making that the option not the default, there is massive power in being able to specify where it gets inserted.

jonathantneal commented 6 years ago

@JamiesonRoberts, even if there’s not a technical fix for this (I don’t know if there is), I suspect there may be a technical strategy to avoid this issue. Could you create a minimal project with this bug and post it on GitHub? I will check it out, replicate the issue, and then work on a fix for you.

JamiesonRoberts commented 6 years ago

@jonathantneal I'll get a minimal project to you this weekend to take a look!

Cheers

jonathantneal commented 6 years ago

Hi @JamiesonRoberts, is this still something you can pursue?

equinusocio commented 5 years ago

Maybe this workaround works:

normalize.css

@import-normalize;

main.scss

@import 'normalize.css';

/* Rest of styles */

Sass should ignore the .css file and inline it (?), then postcss will do the rest if it parse .css extensions.

jonathantneal commented 5 years ago

That solution should work, @equinusocio. I’d love to work something out with the postcss import team, maybe like a custom import hook.