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