rtsao / csjs

:sparkles: Modular, scoped CSS with ES6
MIT License
575 stars 32 forks source link

How to define complex selectors for global styles? #58

Open avesus opened 8 years ago

avesus commented 8 years ago

Like these:

.my-nav-tabs li .active {
  ...
}

when .active is in global scope or is an another class defined in the same csjs literal or imported from another csjs variable..

rtsao commented 8 years ago

If it's defined in the same csjs literal, both instances of .active will be scoped to the same value so there's no change needed. If .active is from another csjs instance, you can pass it in:

csjs`
.my-nav-tabs li ${styles.active} {
  ...
}
`