Hello Sassy folks,
I'm working on a CSS in JS lib (a JS object to CSS compiler, not too far from SASS in JS, actually, since I provide nested selectors and at-rules like you do), and I was wondering on the reason behind the cartesian product done by the & operator omre than once. Specifically:
p, a {
& > & {/*...*/}
}
compiles to
p > p, p > a, a > p, a > a {/*...*/}
rather than a naive
Is there a practical use case for that feature?
It complicates the implementation a bit, and since I want my lib to be usable in the browser, every byte and every clock cycle count (currently it clocks at 2.2KB mingzipped).
When in doubt, I try to follow SASS's lead, since it's AFAIK the most popular CSS preprocessor, but I'm not sure this very feature was that instrumental in SASS's success... For the record, LESS also does the cartesian product while Stylus uses the naive method.
Thanks in advance for your replies,
—Pierre-Yves