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

The camelCase option needs to support string values #40

Closed
evisong opened this issue Mar 22, 2017 · 3 comments
Closed

The camelCase option needs to support string values #40

evisong opened this issue Mar 22, 2017 · 3 comments

Comments

@evisong
Copy link

evisong commented Mar 22, 2017

Hi,

Thanks for this lib, we're heavily using it in our project.

Regarding the camelCase option, setting it to true causes a lot of duplications since original class names are kept, e.g.:

var Styles = {
  'link': 'link-modules__link___3oOIo',
  'linkInGroup': 'link-modules__link-in-group___2fh2a',
  'linkInLinks': 'link-modules__link-in-links___3IT7k',
  'linkDisabled': 'link-modules__link-disabled___2qbP8',
  'link-in-group': 'link-modules__link-in-group___2fh2a',
  'link-in-links': 'link-modules__link-in-links___3IT7k',
  'link-disabled': 'link-modules__link-disabled___2qbP8'
};

In order to solve this, css-modules-require-hook has just supported new string values: only|dashOnly per css-modules/css-modules-require-hook#89 , and released in v4.0.6 https://github.com/css-modules/css-modules-require-hook/releases/tag/4.0.6

camelCase: true|'dashes'|'dashesOnly'|'only'

In latest babel-plugin-css-modules-transform, I found that it limits camelCase to be a boolean:

Error: Configuration 'camelCase' is not a boolean
    at Object.camelCase (.../node_modules/babel-plugin-css-modules-transform/build/options_resolvers/camelCase.js:18:15)

Is it possible to support the new values ('dashes'|'dashesOnly'|'only')?

Thanks.

@michalkvasnicak
Copy link
Owner

Thank you! I will update dependencies and modify camelCase option resolver.

@michalkvasnicak
Copy link
Owner

Released as 1.2.7

@evisong
Copy link
Author

evisong commented Mar 22, 2017

I'm totally impressed by your super fast response, thanks a lot!

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

No branches or pull requests

2 participants