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

Locally Scoped Styles #57

Closed
dav-is opened this issue Dec 16, 2017 · 7 comments
Closed

Locally Scoped Styles #57

dav-is opened this issue Dec 16, 2017 · 7 comments

Comments

@dav-is
Copy link
Contributor

dav-is commented Dec 16, 2017

Right now Styles are globally scoped. I don’t see a benifit in this and it has only caused conflicts between components. Can we change this to a local scope?

@tirthbodawala
Copy link
Member

Hey @dav-is thanks for raising the question, only the Styles in resources are globally scoped and should be used for 3rd party library.
all the css in compnents like
src/components/home/style.scss
Is locally scoped.

@dav-is
Copy link
Contributor Author

dav-is commented Dec 16, 2017

The classnames aren’t scoped. It uses style_${classname} so it may be scoped by the route but the classnames can conflict.

@dav-is
Copy link
Contributor Author

dav-is commented Dec 16, 2017

See “modules” in the css-loader repo. Seems to be set to false in the repo when it should be true

@tirthbodawala
Copy link
Member

@dav-is For development mode only there is style_${classname} for production mode that gets converted to module scoped with hash.

const localIdentName = isResource ?
    "[local]":
    (
      development ? "[name]__[local]" : "[name]_[local]_[hash:base64:5]"
    );

@dav-is
Copy link
Contributor Author

dav-is commented Dec 16, 2017

That’s an issue. CSS doesn’t behave consistently.

@tirthbodawala
Copy link
Member

Creating hash during development is really a heavy process... That is the reason hash is only included in production mode. Can you please explain a scenario where this can cause issue?

@dav-is
Copy link
Contributor Author

dav-is commented Dec 16, 2017 via email

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

No branches or pull requests

2 participants