Css override for both light and dark color schemes

By default selected ListBoxRows have accent color. I want to change it to something more neutral, for example button’s default background color. But there are no similar named color, which would change with libadwaita’s color scheme. I guess it’s possible to watch currently selected color scheme within code and load corresponding css. But I wonder, is there a way to do this with css only? (something like @media(prefers-color-scheme: dark) or maybe it’s possible to copy another’s element color)

Libadwaita lets you have a file named style-dark.css that’s automatically applied to your app when in dark mode. You can read more about how it works here:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.