How to declare a variant with :where() condition on sub-element?
.component .elementThe element you want to style:where(.sub-element)The selector you want to insert
- SASS
+component('article')
+register
+element('.header')
+variant(':where(.emoji, .new)')
display: inline-flex
+__________________________________
+element('.header')
+default
font-size: 1em
+variant(':where(.emoji, .new)')
font-size: 2em
- CSS
article {
display: inline-flex;
}
article .header {
font-size: 1em;
}
article .header:where(.emoji, .new) {
font-size: 2em;
}
More info: +variant, +default, +element, +register, +component, separator +___