How to set text highlight color in a GTK theme

Apologies in advance if this is not the correct forum for this sort question.

I maintain Manjaro themed version of Adwaita-theme, Adwaita-maia. It’s basically just Adwaita with only selected_bg_color altered in scss file. In most applications this produces the desired effect, and the text highlight color is changed to match the green theme color. However, there is one exception to this rule: Firefox highlights text with the stock blue of Adwaita.

It used to use my green, but something changed and I’m not sure what. I’m using a custom css to make Firefox look like a gnome app, but the color is not set there. Downgrading Firefox or the theme does not seem to have an effect. But if I use another gtk theme like matcha-sea, the highlight color changes. So I figured that the problem is likely with Adwaita-maia. It might also be a Firefox issue, but since it works with other gtk themes I find it less likely.

If anyone can give me any pointers on where to start troubleshooting this or where Firefox might be picking its color from, I would appreciate it greatly. Thank you very much for your time!

EDIT: To further narrow down the issue, tested the theme without the firefox theme applied. This had no effect on the issue.

Did you try using GTK Inspector tool ?

1 Like

Not yet, that sounds like an excellent idea. Thank you!

1 Like

Okay, updating the _common.scss against the current gtk master fixed the issue for the light variant, but not for the dark variant. Not sure why that is. I tried using GTK inspector, but I was unable to understand the data it provided. Getting forward though. I’ll try comparing gtk-contained.css and gtk-contained-dark.css.

Okay, the light version had the correct color code in a lot more places than in the dark variant. Editing the css to match those colors did not seem to make a difference though… Continuing to test

The issue was resoved with userContent.css in the firefox theme. Since the issue does not come up anywhere else, it is probably enough.