[jss-isolate] Option for isolation like in shadow dom. #326
Labels
enhancement
No kittens die if we don't do that.
idea
What if we turn JSS into styled-components?
plugin
When unplugged is fine
We can achieve this by defining a default rule name, which will be reset. We can still use inheritance within one component, but it won't spread down to nested components.
We can achieve this by adding an isolate option to the plugin creator.
jss.use(isolate({isolate: true})
is the current behavior, isolates all rules if you don't set isolate: false on a sheet or on a rulejss.use(isolate({isolate: false})
will not isolate any rule by default, to isolate you will need to set isolate: true on a sheet or on the rule.jss.use(isolate({isolate: 'root'})
- will isolate automatically only rules with name "root" or any other name you want to use. This is identical to shadow dom behavior. This allows children in this component to inherit inheritable values, but components which have own roots will be isolated, so that inheritance doesn't spread to all children.The text was updated successfully, but these errors were encountered: