user3813167
user3813167

Reputation:

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

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?

Upvotes: 4

Views: 1485

Answers (2)

James_D
James_D

Reputation: 209330

-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.

Upvotes: 4

DavidPostill
DavidPostill

Reputation: 7921

It's documented immediately below the example 3-5 code at http://docs.oracle.com/javase/8/javafx/user-interface-tutorial/button.htm:

"The -fx-font property sets the font name and size for button1. The -fx-base property overrides the default color applied to the button. As the result, button1 is light green with lager text size, as shown in Figure 3-5."

Upvotes: 0

Related Questions