-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Core: Allow custom postcss config #8498
Core: Allow custom postcss config #8498
Conversation
- Search for the nearest postcss config - Maintain previous defaults if no postcss config
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/storybook/monorepo/1uqipq3zs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together @thollander !
A few thoughts:
- Would it be possible to add the example to an existing
examples/
project rather than creating a new one? I don't want to increase our build times if possible. - Right now
postcss
support is implemented in core, but I'm wondering if we can move it into a preset? Any chance you might be able to take this on? I'd like to move as much as possible out of core to make the default storybook experience lean and mean. This would be a breaking change, so the first step would be to move this into a preset and always include that preset. In a subsequent release (6.0?) we'll make it easy for users to opt-in to those presets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ace 🎯
Yes for sure, I did it. You’re totally right it is not necessary to increase the build time just for this.
I get your point but not sure how to implement it yet. I’ll give it a try. |
Issue: #2455
Old PR: #4411
What I did
find-up
to dependencies to search for the nearest postcss.config.js.postcssrc.json
,postcss.config.js
...) to determine postcss-loader options if present, maintain previous defaults if not.How to test
Run the example
storybook/examples/postcss-kitchen-sink
.The
h1
should have thecolor: #639;
instead ofcolor: rebeccapurple;
.No
I created one, not sure if it was mandatory.
Yes, I added a documentation in
/custom-postcss-config