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

牧云@^-^@ 提交于 2020-01-23 12:29:09

问题


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:


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




回答2:


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



来源:https://stackoverflow.com/questions/24877022/why-is-this-css-property-not-detailed-in-the-javafx-css-reference-guide

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!