Take over the Adwaita theme
I've merged the theme-reorg branch in GTK, so it now using a default theme called Default, and you can take over Adwaita and its variants completely. Beyond copying over the css, this will require some changes to the theme setup.
Until we have some other api in GTK, my suggestions would be:
- Install a css file in /usr/share/themes/gtk-4.0/Adwaita/gtk.css that just contains
@import url('resource:///org/gnome/Adwaita/your-css-file.css')
and similar for other variants. (We need this indirection through the filesystem since GTKs name->stylesheet translation looks in those places. Alternatively, you could invade the GTK resource namespace and install your theme resources in /org/gtk/libgtk/theme)
- Hardcode the theme-name to Adwaita, Adwaita-dark or HighContrast, depending on existing theme and a11y settings, and a new dark-mode setting