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

Meaningful local css selector names #2459

Closed
vitalii-komenda opened this issue Jun 2, 2017 · 4 comments
Closed

Meaningful local css selector names #2459

vitalii-komenda opened this issue Jun 2, 2017 · 4 comments

Comments

@vitalii-komenda
Copy link

vitalii-komenda commented Jun 2, 2017

At the moment local css selector names compiles to meaningless hashes.
For example: :local .foo{} compiles to: ._15QQawvrl5PrjGf9wGoYAO{}

Would be better if original names were prepended to hashes after compilation.

@BrodaNoel
Copy link
Contributor

Weird.
My build has no that kind of hash-names.

For example, this was my last build deployed (link may be broken in a few days after next deploy).

What do you do to get those classnames?
Did you ejected create-react-add and changed something in configs?

@vitalii-komenda
Copy link
Author

vitalii-komenda commented Jun 6, 2017

It works when I import css and mark it as local.
For example:

Inside style.css
:local .foo{}

Inside component.jsx

import style from ./style.css

<div className={style.foo}></div>

@kennethtruong
Copy link

kennethtruong commented Jun 6, 2017

See #90. :local is a css module syntax. There's a PR open to add css modules for .module.css in #2285 which is in progress

@Timer
Copy link
Contributor

Timer commented Jun 6, 2017

We currently don't support CSS Modules and they work accidentally (because we didn't explicitly disable them).
Please do not be surprised if they break until #2285 is merged; see #90 for history as suggested by @kennethtruong.

I'll close this as a dup. Thanks!

@Timer Timer closed this as completed Jun 6, 2017
@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants