Embarking on my CSS journey, I have limited experience since I mainly worked with JavaFX applications and not web languages. In one of my JavaFX applications, I utilized a css style sheet featuring a Windows 10 UWP theme. The default style classes adhere to the standard windows grey button theme, but I also implemented a custom style class for colored components.
The colors are defined as variables within the .root style class for the default style, and then overwritten in the .colored style class for the colored elements.
.root
{
-fill-color: #CCCCCC;
...
}
.colored
{
-fill-color: #DD2867;
...
}
Now, I am faced with the challenge of changing the colors of the colored style dynamically at runtime. I'm familiar with Node#setStyle(String) which allows me to modify the fill color using code like this:
root.setStyle("-fill-color: #FF00FF;");
However, this only affects the color in the .root style class and not the .colored style class.
Is there a way to directly modify a property of a specific style class at runtime, or perhaps a better approach for managing both default and colored styles?
Thank you in advance, Eleom.