JFXtras / jfxtras-styles

Java, JavaFX themes or look and feels. Currently contains JMetro theme.

Home Page:https://pixelduke.com/java-javafx-theme-jmetro/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to override the css styles?

bykka opened this issue · comments

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

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