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-compose][jss-nested] will compose support nested? #918

Open andrewfan opened 5 years ago

andrewfan commented 5 years ago

https://cssinjs.org/jss-compose?v=v5.0.0#caveats Are there any plans to marry compose with nested?

kof commented 5 years ago

I am not against it, but not a high prio.

HenriBeck commented 5 years ago

Why would you need compose inside a nested rule?

andrewfan commented 5 years ago

@HenriBeck it is very usefull when you utility first css frameworks like https://tailwindcss.com/ or have global classes

HenriBeck commented 5 years ago

So you need something like this?

const styles = {
  container: {
    '& > .item': {
      composes: 'container-item',
    },
  },
};
andrewfan commented 5 years ago

@HenriBeck yes, exactly

HenriBeck commented 5 years ago

I don't think this is possible without some overhead and bugs. We would need to run query selectors for applying the classnames.