Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gatsby-plugin-postcss-sass] Separate PostCSS and Sass #2776

Closed
Undistraction opened this issue Nov 3, 2017 · 11 comments
Closed

[gatsby-plugin-postcss-sass] Separate PostCSS and Sass #2776

Undistraction opened this issue Nov 3, 2017 · 11 comments

Comments

@Undistraction
Copy link
Contributor

Undistraction commented Nov 3, 2017

It would seem to me to make more sense to separate PostCSS configuration and Sass configuration. A lot of people (myself included) have moved away from Sass, using Post CSS to retain a few of the choice features alongside CSS modules.

Currently gatsby-plugin-postcss-sass is doing two things - configuring Webpack to handle .scss files and exposing configuration for adding PostCSS plugins. I think it would make more sense if these two were separated. My prefered option would be to split it into two parts: gatsby-plugin-postcss and gatsby-plugin-sass. Otherwise the only other option for someone wanting to use PostCSS without Sass is to fork the plugin and rip out the Sass configuration - if decoupling Sass and postcss isn't an option, would you accept a PR for a gatsby-plugin-postcss which just exposes postcss plugins through its config?

Another option would be to make it a postcss plugin with optional Sass support, toggleable from its config.

@KyleAMathews
Copy link
Contributor

Plugins are cheap :-)

There's plenty of people still using sass so no reason to kill this plugin.

Would be happy to take a PR for a new plugin gatsby-plugin-postcss that makes it easy to add postcss plugins.

There's also an argument that we do this in core as we support postcss there but I like the idea of making postcss configurable through a plugin more than creating an "official" way to modify the core css setup.

@Undistraction
Copy link
Contributor Author

Undistraction commented Nov 3, 2017

Wasn't suggesting you kill it. Just suggesting that the two things were prised apart, so people could use PostCSS without using Sass, but an alternative purely PostCSS plugin is fine.

I'll try and have a look at this next week if you think it's worthwhile.

@KyleAMathews
Copy link
Contributor

For sure! A number of people have asked for easier ways to work with postcss plugins.

@jquense
Copy link
Contributor

jquense commented Nov 3, 2017

FWIW this plugin is removed in v2, it just exposes a postcss plugins option on the sass-plugin. You can use it with postcss that way or seperatelly if you wish

@jquense
Copy link
Contributor

jquense commented Nov 3, 2017

we should add a postcss plugin tho,

@Undistraction
Copy link
Contributor Author

Is there a roadmap for V2 anywhere?

@KyleAMathews
Copy link
Contributor

#2641

@Undistraction
Copy link
Contributor Author

So is it worth me putting together a gatsby-plugin-postcss that takes the current implementation of gatsby-plugin-postcss-sass and removes the sass configuration? How imminent is V2? Given that you are upgrading to Webpack v3 does it make more sense to wait and put together a version that works with that?

@KyleAMathews
Copy link
Contributor

v2 is still a bit away — but if you have a workaround now, it'd be easier to wait for sure.

@Undistraction
Copy link
Contributor Author

I actually spent the day playing with Styled Components and think I'm going to jump down that rabbithole instead of the CSSModules / PostCSS cocktail, so probably don't need right now.

@Chuloo
Copy link
Contributor

Chuloo commented Aug 29, 2018

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues as many of them have already been resolved with the latest updates or explained in a previous issue.

Feel free to open a new one if you still experience this problem or a similar one! 👍

@Chuloo Chuloo closed this as completed Aug 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants