-
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
[v2] css modules class names with dashes / camelCased locals #5458
Comments
|
It makes sense - in this case we would "just" need to update the migration guide so it's documented. I'll leave this issue opened just to get more input on the matter from other folks. |
Yeah, there was a few discussions for this change in the past: |
I was just thinking about it - would it make sense to revert to v1 default and create plugin to easily overwrite css module rule options? Something that walks webpack config object rules and if loader is |
Maybe let's go the other way around? |
@pieh did you happen to write something to allow for v1 behavior? have multiple projects where this change is causing some pain. |
v2 changed how dashes/hyphens in class names handled by css modules were treated: #5458. This was burdensome as it required changing all `className`s that utilized dashes. This allows overriding that change, almost entirely by copying prior art from @yeskunall & @pieh (#9237).
v2 changed how dashes/hyphens in class names handled by css modules were treated: gatsbyjs#5458. This was burdensome as it required changing all `className`s that utilized dashes. This allows overriding that change, almost entirely by copying prior art from @yeskunall & @pieh (gatsbyjs#9237).
what about pt-5 , pt5 not working |
@HamidReazaNikoonia what part 5? |
pt-5 padding-top |
@acalderongarcia have you added this to your module.exports = {
plugins: [
{
resolve: 'gatsby-plugin-sass',
options: {
cssLoaderOptions: {
camelCase: false,
},
},
},
],
} |
Currently in v2 css modules there is undocumented breaking change - dashed class names will be camelCased (
gatsby/packages/gatsby/src/utils/webpack-utils.js
Line 201 in c0e503d
Omitting that setting or setting it to false will result in same behaviour as in v1. Setting it to true or 'dashes' would return both dashed and camelCased version of it - might be worth using that?
The text was updated successfully, but these errors were encountered: