-
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
Enable camelCase by default for CSS Modules #376
Comments
Yeah this makes a lot of sense. Actually I thought CSS Modules did camelCase by default :-) I'll support this change. Anyone else with thoughts? @gatsbyjs/gatsby-core-maintainers This would be a breaking change so wouldn't go in for a bit. |
Why don't you just define your css classes as .camelCase ? |
CSS Modules doesn't enforce it, though it is recommended that you write your classnames in camelCase specifically because of this case. though I'm not sure if I agree with mutating the class names like that. If i write |
I have no excuse... Other than dasherized class/property names have been the standard with CSS for years and old habits die hard, I suppose. 😄 FYI, e.g. // css =
{
"my-class": "gobbledygook",
myClass: "gobbledygook",
} |
Well if it's not a breaking change... I can't see the harm then. |
Ah, well, as long as it doesn't get rid of 👍 |
Same thoughts, adding this option seems reasonable. I didn't know about 👍 |
@tribou still want to add a PR? |
I know gatsby uses Flow. But some more notes for potential restriction on css module names (if you use TypeScript) https://github.com/Quramy/typed-css-modules#remarks |
I have to agree with the comments. Just start writing in camel case. If you're referencing in camel case when it's actually kebab, it's not exactly clear what you're referencing. I agree it takes a bit of getting used to, but it doesn't seem reasonable to add such functionality for the sake of old naming conventions. |
It appears there's too much opposition on this one. Unless we get some more positive comments, I'll close this for now. |
adding a comment in support, we do have this option set for all our projects and I don't think anyone has ever been confused. case transformation accross languages is fairly common concept for programmers I think, especially js ones who often work with backends in other not node. I for one also refuse to write css classes in camelCase, I just can't bring myself to so that :P |
Yeah, I think this is quite reasonable to add. If someone would like to create a PR I'd be happy to merge it. |
Just want to point out that there is automatic conversion from kebab-case to camelCase other places in DOM land:
|
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications we're clearing out old issues as many of them have already been resolved with the latest updates. See a more recent update on this issue with #5458 👍 |
I wanted to bring this up for discussion as I use
camelCase
by default with CSS modules since it lets me key in the class associations a bit faster.With:
Without:
This may just be an opinion piece; but for me, it looks cleaner and can be typed faster.
The text was updated successfully, but these errors were encountered: