Issue
When i try to use the Next-sibling selector (+) in JavaFX i get the following Error:
WARNING: CSS Error parsing globalStyles.css: Expected LBRACE at [2,13]
The CSS File:
/*globalStyles.css*/
.thin-border + .thin-border{
-fx-border-insets: -1;
}
I find this highly confusing since the child selector (>) works perfectly fine and the JavaFX Reference does not mention any Selector being excluded.
Does anyone know why this happens?
Solution
Even though the JavaFX CSS reference links to the level 3 CSS selector document, not all functionality of level 3 selectors is supported. Even if it parses, it is guaranteed to work for all selector types.
If it doesn't parse, it's not supported and won't work.
so there is no way to know until it fails?
Pretty much so.
You could look at the source for the css parser and implementation to see what might work.
But, it is easier just to try it and if it doesn’t work, then it doesn’t work.
There is no complete documentation on what part of the selector specification is implemented.
Answered By - jewelsea
Answer Checked By - Dawn Plyler (JavaFixing Volunteer)