Home > front end >  How to change the color of _selected_ text in a `St.Entry` in a Cinnamon Applet (Gnome)?
How to change the color of _selected_ text in a `St.Entry` in a Cinnamon Applet (Gnome)?

Time:12-15

I use a St.Entry widget in an Cinnamon applet and set the text color via CSS to black.

By chance the selection color of this widget it also black - at least in the theme I use:

Screenshot of St.Entry

This way, selected text is unreadable. :-(

How can I change the selection (background) color or the color of selected text?
Is there a CSS selector available?
Where can I find documentation?

CodePudding user response:

While most of the CSS in GNOME Shell (and Cinnamon) is standard as described on MDN, there are some exceptions. I would typically check the MDN CSS Reference first, then fallback on checking the default stylesheet (for Cinnamon, in your case).

For this case, it looks like it's selection-background-color, which is not standard I think:

StEntry {
    /* Regular coloring */
    color: rgb(200, 200, 200);
    background-gradient-start: rgb(128,128,128);
    background-gradient-end: rgb(85,85,85);
    background-gradient-direction: vertical;

    /* Entry-specific coloring */
    selected-color: #ffffff;
    selection-background-color: #000000;

    caret-color: #cccccc;
    caret-size: 1px;
}
  • Related