When trying to style with css something like the following key:
<g transform="translate(28, 56)" class="key keypos-0">
<rect rx="6" ry="6" x="-26" y="-26" width="52" height="52" class="key side"/>
<rect rx="4" ry="4" x="-20" y="-24" width="40" height="40" class="key"/>
<text x="0" y="-4" class="key tap">F1</text>
</g>
To style the middle rect on some nested selector you need to use a discriminator as follow:
.key {
... /* general styling for the whole key */
.key:not(.side, .tap, .hold) {
.... /* specific styling for the rect that is not containing other selector */
}
}
It will be really nice in such cases to have a class such main (maybe there would be a better name) to avoid such complex selection. Maybe I am missing a better way of doing it, so feel free to close if that is the case. Thanks! 😊