JFXtras / jfxtras-styles

Java, JavaFX themes or look and feels. Currently contains JMetro theme.
https://pixelduke.com/java-javafx-theme-jmetro/
642 stars 144 forks source link

How to override the css styles? #192

Closed bykka closed 3 years ago

bykka commented 3 years ago

Hello,

I would like to apply globally another font for my application. Before I used the next CSS

* { -fx-font-family: Consolas, monospace; }

but after applying JMetro it does not work anymore. Does someone have a suggestion on how to change the font?

here is an example of how it's applied. And of cause, I tried to add 'global.css' in a different order. image

dukke commented 3 years ago

Please check JMetro documentation page: https://pixelduke.com/java-javafx-theme-jmetro/ check the section "Not like Modena".

Also check the JMetro stylesheet, namely base.css. You need to make sure your rules have a higher or equal specificity than the rules set by JMetro. If they have equal they need to come afterwards in order to override the ones from JMetro. In the JMetro stylesheet search for every time there is a font-family definition and make sure you override them in your rules (through a higher or equal specificity).