Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is this CSS property not detailed in the JavaFX CSS Reference Guide?

Tags:

java

css

javafx

I'm learning how to use CSS to style UI components in JavaFX, and in going through Oracle's tutorials I found the color property -fx-base in a piece of example code: http://docs.oracle.com/javase/8/javafx/user-interface-tutorial/button.htm (example 3-5, the very last piece of code on the page).

In the complete JavaFX CSS Reference Guide (http://docs.oracle.com/javase/8/javafx/api/javafx/scene/doc-files/cssref.html), there is clear documentation on every property I have seen so far EXCEPT -fx-base, and it seems that it isn't in the reference guide at all. Am I searching in the wrong place or is it missing? Are there any other undocumented properties?


1 Answers

-fx-base is a looked-up color - not really a property - defined in the default modena.css stylesheet.

Looked-up colors effectively work as color-valued variables which can be set on a node in the scene graph. They propagate to descendant nodes. The default stylesheet uses looked-up colors extensively. Almost (but not quite all) colors used in modena are defined in terms of -fx-base.

To my knowledge, there's currently no official documentation on which looked-up colors are defined and how they are used. You can, and I do fairly frequently, dig into the modena.css source code to see how to use and manipulate these.

like image 172
James_D Avatar answered Sep 07 '25 05:09

James_D



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!