Skip to main content

How to exclude some of the multiple variants?

.component.primary, The selector you want to omit.componentThe element you want to style.secondaryThe selector you want to keepThe selector you want to omit, .component.tertiary
+component('.component')
+register
+variant('{priority}', '.primary', '.secondary', '.tertiary')

+default
display: flex

+variant('{priority}')
+default
display: inline-flex

+only-for('.primary')
background: red

+only-for('.secondary')
background: green

+only-for('.tertiary')
background: blue





.component {
display: flex;
}

.component.primary, .component.secondary, .component.tertiary {
display: inline-flex;
}
.component.primary {
background: red;
}
.component.secondary {
background: green;
}
.component.tertiary {
background: blue;
}

More info: +only-for, +variant, +register, +component