-
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
feat(gatsby-plugin-postcss): added css-loader options #10861
Conversation
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.
This looks like it should work, but
...should the API be eg "cssLoaderOptions" for clarity? |
yup, that makes sense, i've changed it to cssLoaderOptions. thanks |
Does this PR mean i'd be able to set the
Amazing if so. Let's get this in! |
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.
I've updated the README.md and added cssLoaderOptions to our non-modules rule too.
It's ready to be MERGED! Thank you!
We also need to update jest snapshots as seems slight order change of options make them fail |
Hey there - anything I can do to help with this PR? It looks like this would be helpful for a project I'm working on. My use case:
In other words...import classes from './Footer.module.css';
console.log('footer classes', classes); This results in Camel Case from gatsby:Skewer-case from storybook:This essentially renders storybook and gatsby incompatible for my purposes. I'm hoping this PR would help me address that! |
i'll get this one merged tomorrow @mbifulco |
heyo... sorry i've not had a chance to take another look at this... let me know if there is anything i can do to help. cheers |
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.
Ready to go! Thanks for your patience!
I hate to be a pain, but it looks like failing tests may be holding this up. Is that jest missing a snapshot update? |
sorry fell sick yesterday, updated the snapshots 🤞 |
Ah sorry to hear you were under the weather. I hope you're back at full steam now! Thank you, @wardpeet @magicspon @pieh! 🙏 |
Just coming back to say that this absolutely did the trick for me. Thanks, y'all! This is the postcss config I needed: {
resolve: `gatsby-plugin-postcss`,
options: {
cssLoaderOptions: {
camelCase: true,
},
},
}, and this is a screenshot of thegymnasium.com's new footer design running simultaneously in storybook and |
Description
This commit allows users to define some css-loader options, such as
localIdentName
cssOptions
is the new bit.Related Issues
Some of my class names were getting stupidly long!