Reputation: 739
I'm using RichTextFx (CodeArea) to highlight my code. I want to change text background color for some keywords and use css below:
.parameter {
-rtfx-background-color: yellow;
}
But it's changes background color for all text between my keywords (:p1
and :p2
in this example). Font color and style change successfully.
Upvotes: 3
Views: 1545
Reputation: 1
Just encountered the same problem.
To override JavaFX default styles in RichTextFX, use !important
in your CSS. For example, -fx-background-color: #1E1E1E !important;
ensures the background color is applied even if other styles are set, ensuring that your custom background color takes precedence.
Upvotes: 0
Reputation: 75
use StyleClassedTextArea.setStyleClass(from, to, "class Name");
to add class name to some specific range.
Upvotes: 1