Skip to content
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

Add camelCase option for css-loader #2393

Closed
wants to merge 1 commit into from
Closed

Add camelCase option for css-loader #2393

wants to merge 1 commit into from

Conversation

roman-holovin
Copy link

Resolves #376

Docs: https://github.com/webpack-contrib/css-loader#camelcase

This is not a breaking change, given css

.my-header { color: blue}

will result in such object

{
    my-header: "src-pages----index-module---my-header---2Xmei", 
    myHeader: "src-pages----index-module---my-header---2Xmei"
}

@KyleAMathews
Copy link
Contributor

Deploy preview failed.

Built with commit 834f019

https://app.netlify.com/sites/using-glamor/deploys/59da4f64a6188f79f5d196de

@mingaldrichgan
Copy link
Contributor

Would this be a breaking change if a CSS file already has, e.g. both .my-header and .myHeader defined with different styles?

@KyleAMathews
Copy link
Contributor

@mingaldrichgan since this is opt-in, it wouldn't be a breaking change. You can only break things if you enable it :-)

@KyleAMathews
Copy link
Contributor

Oh nvm, this isn't an option. @Dantix yeah, this would break things. So to get this in, you'd need to make this optional using plugin options.

@jquense
Copy link
Contributor

jquense commented Oct 10, 2017

I don't think this is being made configurable here, but turning it on by default?

@roman-holovin
Copy link
Author

roman-holovin commented Oct 16, 2017

Thanks, I see your point.
Problem is that CSS loader configuration is used by a lot of other plugins, like gatsby-plugin-less, they all leverage cssModulesConfig function. So if for example we choose to extend it, so it can provide additional options to loader, all code, which currently uses it, will need to be updated also.

Since I'm only getting grasp on gatsby and this is going to be not so trivial change as I've anticipated, I would like you to give your opinion ( @KyleAMathews @jquense ) on how this problem can be approached in an extensible and non-breaking way.

@KyleAMathews
Copy link
Contributor

I'm not sure this is worth worrying about right now. I believe when we switch to webpack 3, these sorts of changes will be simpler.

If you want to research more a possible fix @Dantix that'd be great but I don't see camelCase or not being a big deal for using css modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants