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

css className conflict #48

Closed
chenxsan opened this issue Sep 8, 2015 · 3 comments · Fixed by ryan-ally/react-examples#11 · 4 remaining pull requests
Closed

css className conflict #48

chenxsan opened this issue Sep 8, 2015 · 3 comments · Fixed by ryan-ally/react-examples#11 · 4 remaining pull requests

Comments

@chenxsan
Copy link

chenxsan commented Sep 8, 2015

Just set up a repo https://github.com/chenxsan/css-module-class-conflict to demo this problem, I had these css codes

.title {
  composes: small from './border.css';
  composes: small from './borderRadius.css';
}

in app.css, expected the exported class name to be border__small__xxxxx borderRadius__small__xxxxx, but i got this:

screen shot 2015-09-08 at 16 19 59

I got two borderRadius__small__xxxxx, the first small was overwritten by the second small.

Is this an expected behavior?

@chenxsan chenxsan changed the title css class conflict css className conflict Sep 8, 2015
@saintwinkle
Copy link

Because you have assigned variable 'small' twice.
Try to use 'smallA' and 'smallB', or something else to make a distinction.

@NekR
Copy link

NekR commented Sep 8, 2015

@saintwinkle What? This breaks all the concepts of the encapsulation/modules. small is not a variable, but key (read css class) in both border.css and borderRadius.css. Having smallBorder and smallRadius in css files mean that then there is no sense to use CSS Modules at all (since class names are not unique).

If this really happens, then it's just a bug. Bad bug, but still simply a bug (and not conceptual feature).

@sokra
Copy link
Member

sokra commented Sep 10, 2015

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