question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change Default Text Color

See original GitHub issue

first this looks like a cool control, thanks for the hard work.

I’m trying to implement a personal editor based on pandoc markdown. I want to implement syntax hi-lighting for it and stumbled across your project. I ran the java keyword demo included with the source. It looked nice, however when I spend long stretches at the computer I prefer an editor with a black background, think darcula in Intellij or Norway Today in Netbeans. So I proceeded to change the background colour to black, which was easy enough to achieve, I just added the following to the css file:

.styled-text-area{
    -fx-background-color:black;

}

With a little googling I found that I had to set the fill for the text as follows:

.styled-text-area .text{

    -fx-fill:yellow;
}

However when I set the fill as above there is no longer any syntax hi-lighting everything is yellow. So I was wondering if this is a bug or if there is some other way to change the default text colour.

Anyway to replicate just add the above to the java-keywords.css file.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
TomasMikulacommented, Sep 1, 2015

It is actually not public API, but it so happens that the caret is a Path with zero area and stroke of width 1px and has the class caret, so you can customize its color like this:

.styled-text-area .caret {
    -fx-stroke: yellow;
}
0reactions
silenuzcommented, Sep 1, 2015

Is it possible to change the caret color? When changing fill on a TextArea the caret changes to the same color as the fill, however when setting the fill in the StyledTextArea the caret does not change and remains black. Is there a way to change the caret color?

-Jordan

On 08/31/2015 02:18 PM, Tomas Mikula wrote:

You need |.styled-text-area .text.keyword| etc., i.e. no space between |.text| and |.keyword|.

|.text .keyword| means a node with class |keyword| that is a descendant of a node with class |text|, while |.text.keyword| means a node with classes |text| and |keyword|. Peculiarities of CSS.

— Reply to this email directly or view it on GitHub https://github.com/TomasMikula/RichTextFX/issues/172#issuecomment-136451413.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change the default font or text color for email messages
Change the default font, color, style, and size for messages · On the File tab, choose Options > Mail. · Under Compose messages,...
Read more >
How to change the default text color in Word - in 1 minute!
The little things make all the difference. If you're constantly having to change the text color in Microsoft Word to something you favor, ......
Read more >
How to change default text color for entire site - Stack Overflow
I thought that simply changing the body color in the CSS would change the default color: body { font-family: Lato; font-size: 14px; line-height ......
Read more >
How to Change the HTML Font Color - Kinsta
The two primary methods of changing the HTML font colors are to use the font tag or CSS styles. Both of these methods...
Read more >
How to change the default font or text color for email ...
Users can change the font and text color of email messages according to their ... to change default fonts and styles, colors and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found