Skip to main content

How to declare a state on sub-element?

.component .elementThe element you want to style:activeThe selector you want to insert
+component('.btn')
+register
+element('.icon')
+state(':active')

display: inline-flex

+___________________
+element('.icon')
+default
background-color: grey

+state(':active')
background-color: red





.btn {
display: inline-flex;
}

.btn .icon {
background-color: grey;
}

.btn .icon:active {
background-color: red;
}

More info: +state, +default, +pseudo-element, +element, +register, +component, separator +___