-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Strange behavior Autoprefixer #318
Comments
Sounds reasonable :-) I only use inline styles so not entirely up to speed on this stuff. Would you like to put together a PR to make the updates? |
Also, you want to add a link to your starter to the README? It's looking great! |
Ok, then I'll create a PR now!
Yeah, it would be great =) In the Readme there is a section with the official starters |
@WPioneer I added Lumen just now to the README :-) https://github.com/gatsbyjs/gatsby#gatsby-starters Is there a online demo of it somewhere? I'll add a link for that as well if there is. |
@KyleAMathews Thank you, I added ;) |
I'm struggling to modify the autoprefixer settings as well. I've tried your solution @WPioneer but can't get any prefixed value. I need support for IE9. I've even tried changing the default values in Gatsby's I couldn't find |
For anyone struggling with this and stumbling upon this thread. I solved it the following way:
I realised that using SASS the PostCSS module wouldn't even be triggered, thus the cssnext config that I was trying to modify wasn't even used. |
@marcelkalveram I'm trying your solution but I'm getting:
Any ideas? |
@zebapy That looks like a problem in your |
@marcelkalveram I removed all contents of |
@marcelkalveram no luck still. any ideas? |
autoprefixer-loader suggests using postcss instead https://github.com/passy/autoprefixer-loader postcss-loader is already setup for prefixing so you should be able to do something like:
You'd then need to modify the postcss settings to prefix for more than just the past two versions of browsers — gatsby/lib/utils/webpack.config.js Line 354 in 80370d7
|
Thanks @KyleAMathews For others, this is what I needed because I'm using Sass:
|
I had to adapt the example above a little to get it working. I guess partly due to API changes of Gatsby? Main changes are: use destructuring to get the Additionally I enabled source maps for Maybe this helps others who are stumbling over this too:
|
@kriim thanks for the example, it was helpful. Something is confusing me though, why in the build stage is it |
It was like this in the config I adapted. I guess it's due to the But I'm new to the Webpack game myself ;) ... |
Unfortunately the proposed workaround didn't work for me—still no prefixing. |
This was observed in my Blog and gatsby-starter-lumen.
I changed the cssnext configuration in gatsby-node.js:
CSS-prefixes are not changed. But they changed after adding postcss-loader to inline CSS html.js#L18. (I think that this is bad practice):
Perhaps this is due to cssnano, which is used in conjunction with cssnext. Because if you remove cssnano of webpack.config.js, then the problem is solved. https://github.com/wpioneer/gatsby/commit/ba330c22759a3a07e244262a0c95625fa0ba7bee
Therefore, I think it's better to use css-loader, which is already used cssnano:
http://cssnext.io/postcss/#postcss-loader
https://github.com/webpack/css-loader#minification
The text was updated successfully, but these errors were encountered: