How to declare a state on parent element?
.component .parent-element:hoverThe selector you want to insert .elementThe element you want to style
- SASS
+component('.btn')
+register
+element('.icon')
+state(':hover')
+element('.prefix')
display: inline-flex
+___________________
+element('.icon')
position: relative
+___________________
+element('.prefix')
+default
background-color: grey
+state(':hover')
background-color: red
- CSS
.btn {
display: inline-flex;
}
.btn .icon {
position: relative;
}
.btn .icon .prefix {
background-color: grey;
}
.btn .icon:hover .prefix {
background-color: red;
}
More info: +state, +default, +pseudo-element, +element, +register, +component, separator +___