whoisvadym / eleventy-plugin-postcss

Eleventy plugin for PostCSS library
11 stars 2 forks source link

Using eleventy-plugin-postcss with Sass (scss) #2

Closed netopolit closed 2 years ago

netopolit commented 2 years ago

Is there an (easy) way to apply PostCSS transformations to Sass (SCSS) files or sass-compiled CSS file? Specifically I'd like to use this plugin with eleventy-sass but I'm not sure if there is a way to chain outputs (probably not). Other ideas for combining this plugin with eleventy-sass are welcome.

Thank you.

whoisvadym commented 2 years ago

Hi @netopolit, Thanks for using the plugin!

I'm curious to learn more about your use case. From my experience teams tend to pick either Sass or PostCSS, not both.

I don't think it would be possible to process SCSS syntax via PostCSS pre-processor (or vice-versa) because their syntax is different in most cases. The same goes for chaining since the output of the SCSS pre-processor will have to correctly parse and pass through an unprocessed PostCSS syntax into an output file.

netopolit commented 2 years ago

Thanks for the tip. This has been solved for me both by your suggestion and a new feature in eleventy-sass. PostCSS provides different functionality via plugins (e.g. autoprefixer and other useful transforms) that Sass doesn't offer. On the other hand Sass is very mature and great at what it does so I'm not trying to replace Sass functionality.

Thanks.