Skip to content

Enable camelCase by default for CSS Modules #376

Closed
@tribou

Description

@tribou

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.

/* CSS */
.my-class {
}
.my-other-class {
}

With:

// css-loader?modules&camelCase
import Cn from 'classnames'
import css from './MyComponent.module.css'
...
css.myClass
Cn(css.myClass, css.myOtherClass)

Without:

// css-loader?modules
import Cn from 'classnames'
import css from './MyComponent.module.css'
...
css['my-class']
Cn(css['my-class'], css['my-other-class'])

This may just be an opinion piece; but for me, it looks cleaner and can be typed faster.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions