Note that -fx-control-inner-background
is not a CSS property, but a "looked-up color" (essentially a CSS variable) that is defined in the default stylesheet, modena.css
.
To the best of my knowledge, there's no official documentation that describes the looked-up colors used by modena. The only resource I know for finding these is the source code, which quite carefully documents the purpose and use of these variables.
It is valid to be concerned about back-compatibility when relying on undocumented functionality. I'd make the following arguments, that alleviate this concern to some extent:
- The design of modena.css makes it quite clear the intention is that the looked-up colors defined in there are intended to be a mechanism for easily theming an application, and as such are written as though they are an API
- Using these looked-up colors is in widespread use in the JavaFX programming community, and removing them from modena.css in a subsequent version would break a lot of code and be met with substantial opposition from the community. As such, these form a "de-facto API".
The call
setUserAgentStylesheet(Application.STYLESHEET_MODENA);
in the Application
subclass will ensure that modena is used as the default stylesheet, so if a new default stylesheet is defined for future JavaFX releases, this code will future-proof your application, under the "de-facto API" assumption in the previous bullet point. (Note this also gives the JavaFX team a way forward to create a new stylesheet without breaking existing code, which I think strengthens the "de-facto API" argument.)
So, on balance, I think relying on the looked-up colors that you can find in the modena.css source code is a safe approach.