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

[jss-namespace] remove option "named", introduce a plugin instead. #241

Closed
1 of 2 tasks
kof opened this issue Jun 7, 2016 · 2 comments
Closed
1 of 2 tasks

[jss-namespace] remove option "named", introduce a plugin instead. #241

kof opened this issue Jun 7, 2016 · 2 comments
Labels
enhancement No kittens die if we don't do that.

Comments

@kof
Copy link
Member

kof commented Jun 7, 2016

Problems it solves:

  • ambiguity of keys, with named: true it is rule names, with named: false it is selectors
  • SSR requires a different class name generation algorithm

JSS without jss-namespace plugin generates global selectors.
Once plugin is used, class names are generated using counter, like it is right now + user can specify a function which can use for e.g. murmurhash to generate an id. This will make it predictable and enable rehydration. #221

@kof
Copy link
Member Author

kof commented Sep 28, 2016

In this conversation https://github.com/styled-components/comparison/pull/33/files#r80881006 I have got a different idea.

What if we move global styles to a separate plugin?
We can make then an option {global} as well as json key global, which will allow to create global styles right within local sheet.

{
  global: {
    html: {globalStyles},
    button: {globalStyles}
  },
  button: {localStyles}
}

@kof
Copy link
Member Author

kof commented Sep 28, 2016

Closing this issue in favor of #324

@kof kof closed this as completed Sep 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement No kittens die if we don't do that.
Projects
None yet
Development

No branches or pull requests

1 participant