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] improve API, so plugin could accept multiple configs #699

Open yakhinvadim opened 6 years ago

yakhinvadim commented 6 years ago

Motivation

See https://github.com/cssinjs/jss/issues/698#issuecomment-380503169

TODO

yakhinvadim commented 6 years ago

Right now in order to implement the behavior I described in Motivation section, we'd need to merge two configs:

// 1
jss.use(
  isolate({
    isolate: 'root',
    reset:  'all' // or just 'inherited', because 'non-inherited' part is covered in second config
  })
);

// 2
jss.use(
  isolate({
    reset: 'non-inherited'
  })
);

The first questions is: is it OK to introduce new 'non-inherited' keyword for this use-case?