I have seen the recommended syntax as below -
.A:selected {
-fx-background-color: green;
}
But that didnt work for me. I got it working using -
:selected .A {
-fx-background-color: green;
}
Also, what is the syntax to apply the same style for multiple classes when selected? This worked for me, but wanted to know if there is a better/more concise syntax...
:selected .A, :selected .B, :selected .C {
-fx-background-color: green;
}