RichTextFX: "-fx-highlight-text-fill" CSS doesn't work due to JDK bug

Sorry for yet another issue, but…

I’m on 1.0.0-SNAPSHOT and it seems that setting -fx-highlight-fill and -fx-highlight-text-fill aren’t working as expected. I’m following the instructions here: https://github.com/TomasMikula/RichTextFX/wiki/Styling-RichTextFX-and-a-CSS-Cheat-Sheet#cheat-sheet

The bottom part of the attached image is from a StyleClassedTextArea. You can see that the text is being styled correctly (it’s got a class of “header”), but the highlight CSS isn’t. no-fill-no-chill

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Reactions: 1
  • Comments: 17 (7 by maintainers)

Commits related to this issue

Most upvoted comments

@eckig No, #398 it does not fix -fx-highlight-text-fill.

I tried to fix -fx-highlight-text-fill in commit https://github.com/JFormDesigner/RichTextFX/commit/0683c01aaf7e93657f1b4ae281a5aaf1abfc6f23, but it does not work 100% because of a bug in JavaFX. For details see commit message.

For Markdown Writer FX I’m going to workaround the problem with the unreadable selected text with a brighter background selection color:

.styled-text-area {
    -fx-highlight-fill: derive(#1E90FF, 100%);
}