nathanmarks / jss-theme-reactor

NOT MAINTAINED Powerful theming layer for use with the jss CSS in JS library
MIT License
64 stars 6 forks source link

Keep the theme hash constant #30

Closed AlastairTaft closed 7 years ago

AlastairTaft commented 7 years ago

This change allows you to update the theme and not need to update all the class names on the page for the new styles to apply.

Now when you apply the below code any css using the 'primaryColour' prop will update on the screen.

styleManager.updateTheme({
  primaryColour: 'red',
})

Before, all the style sheets would end up being removed and then when a new style sheet is added the existing class names won't match up because the hash changes.

AlastairTaft commented 7 years ago

Alternatively, can we update the code so we can pass in our own 'generateClassName' method. At the moment it gets overridden with the internally created one.

I'd like to experiment with not using a hash. I know this goes against most of the ideas of scoping the style sheets but being able to customise stuff with global css might be nice for my use case.