Skip to main content

How to declare a state on pseudo-element?

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

display: inline-flex

+___________________
+element('.icon')
position: relative

+_________________________
+pseudo-element('before')
+default
background-color: grey

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






.btn {
display: inline-flex;
}

.btn .icon {
position: relative
}

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

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

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