Here's what I'm ultimately trying to do:
.books, .dvds, .magazines {
article &.books {
/* Wanting the selector to only be ".books article" */
}
article {
/* Can apply to any of the `article` tags under .books, .dvds and .magazines */
}
}
I've got some nested selectors and instead of breaking out a new .books article
selector, I'd like to keep them nested, but still only target article
elements under .books
.
I did try this, and it works, but the output is .books.books article
, which is redundant and makes me cringe:
.books, .dvds, .magazines {
&.books article {
/* Outputs ".books.books article, .dvds.books article, .magazines.books article"...boooo, hisssss */
}
}
What about something more like:
article {
.books &,
.dvds &,
.magazines & {
/* book, dvd, magazine shared stuff */
}
.books & {
/* book stuff */
}
}
compiles to:
.books article, .dvds article, .magazines article {
/* book, dvd, magazine shared stuff */
}
.books article {
/* book stuff */
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With