macaron-css / macaron

Compiler-augmented typesafe CSS-in-JS with zero runtime, colocation, maximum safety and productivity
https://macaron.js.org/
MIT License
735 stars 16 forks source link

Question: is it possible to use child selectors? #33

Closed itsjavi closed 1 year ago

itsjavi commented 1 year ago

I know that with vanilla-extract it is not possible to use child element selectors when defining the styles, e.g.:

export const myList = style({
  position: 'relative',
  display: 'block',
  listStyle: 'none',
  color: 'inherit',
  '> li': {
     padding: '1rem',
  }
})

Is it possible to accomplish something like this in macaron or does it have the same limitation?

Having to write a separate style for each child selector is IMHO a lot of boilerplate and it defeats the purpose of cascade style sheets.

EDIT: moved to discussions https://github.com/macaron-css/macaron/discussions/34