CSS Background color of selected file in standard view ignored when "show file highlight" is enabled

Version information

thunar 4.20.9

Arch Linux, kernel version 7.1.9-arch1-2

Steps to reproduce

Enable View --> Show File Highlight in thunar

Go on to GTK 3.0 config directory (or use Gtk Inspector) and modify gtk.css by adding this lines:

.thunar .standard-view .view:selected { background-color: green; }

I encounter the problem even by using GTK color functions like:

.thunar .standard-view .view:selected { background-color: alpha(@theme_selected_bg_color, 0.25); }

Current behavior

No matter what you do to modify the background color of the selected file using gtk.css config file, the color will always be the same as @theme_selected_bg_color definition in the gtk.css config file, suggesting a seemingly hardcoded value.

Expected outcome

I wanted the background color of the selected file to match the one of a selected folder in the sidebar view since it's easier on my eyes and it looks more uniform.

Unfortunately, everything I tried didn't seem to work. I tried modifying the CSS directly by using GTK_DEBUG=interactive, I also tried adding !important at the end of the CSS rule.

The funny thing is that only the background-color property doesn't change when overriding it in the gtk.css file.

A piece of code like this would work without any problem:

.thunar .standard-view .view:selected { color: red; }

Also I noticed that the color doesn't change only when targeting :selected pseudo-class, so something like this is working as expected:

.thunar .standard-view .view { background-color: @any_color; }

In my opinion, the expected behavior should be to follow the user's defined CSS properties, without applying the color solely based on the @theme_selected_bg_color definition.

Additional information

Using:

@define-color theme_selected_bg_color rgb(255, 0, 0);

.thunar .standard-view .view:selected { background-color: alpha(@theme_selected_bg_color, 0.25); }

produces a result like this:

image.png

If I directly use the color definition with an alpha value then I get a different result:

@define-color theme_selected_bg_color rgba(100%, 0, 0, 0.25);

.thunar .standard-view .view:selected { background-color: green; }

image.png

As you can see, the background-color property is completely being ignored.

Edited by Alexander Schwinn