I\'ve been inspecting the \"caspian.css\" distributed by Oracle in the JavaFX runtime library, and I see they have declared some color values as variables. Eg:
I aways separate my css code.
I create a importer file named all.css with code bellow:
@import url("Root.css");
@import url("Base.css");
...
In Root.css file, i set the variables:
.root {
-fx-color1: #FFFF00;
-fx-color2: rgb(255,255,0);
-fx-color3: rgba(255,255,0, 0.5);
}
Now, i can call variables in all bellow of imported code after import(Root.css). In Base.css for example.
.bg-yellow1 {
-fx-background-color: -fx-color1;
}
That's it!