How to address any sub-element?
.component .element *The element you want to styleThe selector you want to insert
This is a case where the SPOT rule seems to be violated, because we are addressing elements that can be addressed by other selectors (even from other components).
Yes, it is possible to use mixin +element, but it is better to mark such a case with mixin +spot-exception-element.
- SASS
+component('.component')
+register
+element('.element')
+spot-exception-element('*')
display: inline-flex
+________________________
+element('.element')
position: relative
+____________________________
+spot-exception-element('*')
display: inline-block
- CSS
.component {
display: inline-flex;
}
.component .element {
position: relative;
}
.component .element * {
display: inline-block;
}
More info: +spot-exception-element, +element, +register, +component, separator +___