I am not sure whether CSS in JavaFX is supposed to be case sensitive or insensitive. The JavaFX CSS Reference Guide says: Boolean values can either have the string value of "true" or "false", the values are case insensitive as all CSS is case insensitive. The book Learn JavaFX 8 says: The Style class names in JavaFX are case sensitive.
However, using the following CSS:
.root {
-sidebar-R: #FF0000;
-sidebar-L: #00FF00;
}
and Java code:
group.setStyle("-sidebar: -sidebar-R;");
work fine together, unless the undelying css file is compiled to a bss file. I observed that in the bss file, all CSS names are converted to lowercase. Within the compiled bss file, -sidebar-R can not be resolved any more!
Of course, the workaround and best practise is to not use uppercase letters in CSS at all - but the different behavior between css and bss is confusing.
However, using the following CSS:
.root {
-sidebar-R: #FF0000;
-sidebar-L: #00FF00;
}
and Java code:
group.setStyle("-sidebar: -sidebar-R;");
work fine together, unless the undelying css file is compiled to a bss file. I observed that in the bss file, all CSS names are converted to lowercase. Within the compiled bss file, -sidebar-R can not be resolved any more!
Of course, the workaround and best practise is to not use uppercase letters in CSS at all - but the different behavior between css and bss is confusing.
- relates to
-
JDK-8088296 [CSS] Selector matching should be done on lower-case strings
-
- Open
-