Add support PostCSS plugins
See original GitHub issueHow to use additional PostCSS plugins like tailwindcss?
plugins: () => [
require('postcss-flexbugs-fixes'),
require('postcss-preset-env')({
autoprefixer: {
flexbox: 'no-2009',
},
stage: 3,
}),
],
Can we extends this to use some other plugins?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:8 (4 by maintainers)
Top Results From Across the Web
postcss/plugins.md at main - GitHub
postcss -custom-properties supports variables, using syntax from the W3C Custom Properties. postcss-custom-selectors adds custom aliases for selectors. postcss- ...
Read more >What is PostCSS? How to Use Plugins to Automate CSS Tasks
One of the basic and most important plugins to use is postcss-import. It lets us import CSS files into other files. To check...
Read more >PostCSS - IntelliJ IDEs Plugin - JetBrains Marketplace
Brings support for PostCSS: The IDE now recognises .pcss files. You can also enable PostCSS support for your .css files in Preferences |...
Read more >PostCSS Language Support - Visual Studio Marketplace
Open the command palette and select Extensions: Install Extensions; Search for PostCSS Language Support; Click Install ...
Read more >So you want to make a PostCSS plugin - CSS-Tricks
PostCSS plugins should be created to do one particular thing; it can be as simple as adding a :focus selector to every :hover...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@patricklafrance Thank you for your great reply It’s really helps, but I don’t like to overrider CRA, just like use CRA as CRA.
and Tailwind CSS becomes most popular utility-first CSS framework seems 22,833 weekly downloads ( ref: https://www.npmjs.com/package/tailwindcss ) so my suggestion CRA users use Tailwind CSS without extending or customize CRA.
CRA can apply postcss tailwindcss plugin only tailwind.js ( recommenced config file from https://tailwindcss.com/docs/installation#2-create-a-tailwind-config-file ) in root directory
@gaearon may you please have a look and advice on this please? 🙏
Hi @pavinthan,
CRA doesn’t support this use case.
The official recommendation from CRA is to make your own fork and customize PostCSS to your needs.
You can find the documentation here: https://facebook.github.io/create-react-app/docs/alternatives-to-ejecting#docsNav
As an alternative to create a fork, you could use craco and follow this recipe to extends the PostCSS plugins.
As @Timer mentioned in other issues, using craco is very prone to breaking since it’s an hacky layer on top of CRA to make it more configurable.
That begin said, at Sharegate all our new apps use CRA + craco and they all extends the PostCSS config to add additional CSS features and PostCSS plugins.
This means that you can be confident that if CRA introduce a change that breaks how craco makes PostCSS configurable we will try to fix it as soon as possible.
Hope it helps!