cssinjs / jss

JSS is an authoring tool for CSS which uses JavaScript as a host language.
https://cssinjs.org
MIT License
7.06k stars 397 forks source link

[jss-isolate] how isolate from globals #693

Closed adantoscano closed 6 years ago

adantoscano commented 6 years ago

Hi! I'm developing a react widget to insert in many webs but I got problems with global styles. i.e. lot of webs got img{ heigth: 100% }. I tried jss-isolate but imgBtn: { isolate: true } doesn't reset heigth property. There is any way to reset global styles from parent componet to children?

kof commented 6 years ago

When you setup the plugin, you need to use https://github.com/cssinjs/jss-isolate#option-reset option rest: 'all'

kof commented 6 years ago

height: auto should be applied then https://github.com/iamstarkov/css-initials/blob/master/all.js#L123