gnome: route headerbar CSS through stylix.targets.gtk.extraCss

Plain gtk.gtk{3,4}.extraCss is silently dropped once stylix owns the
theme — stylix prints an evaluation warning and writes nothing. Move
the headerbar-shrink customisations to stylix.targets.gtk.extraCss so
they actually apply.

Also switch qt.platformTheme from the deprecated "gnome" to "adwaita".

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
ediblerope 2026-05-11 19:59:19 +01:00
parent 7d5965a884
commit 2d631c86da

View file

@ -49,7 +49,7 @@
qt = { qt = {
enable = true; enable = true;
platformTheme = "gnome"; platformTheme = "adwaita";
style = "adwaita-dark"; style = "adwaita-dark";
}; };
@ -60,13 +60,10 @@
home-manager.users.fred = { config, lib, pkgs, ... }: { home-manager.users.fred = { config, lib, pkgs, ... }: {
# Minimal titlebars — stylix manages the GTK theme; we layer our # Minimal titlebars — stylix manages the GTK theme; we layer our
# headerbar shrink on top via programs.gtk.*.extraCss. # headerbar shrink on top via programs.gtk.*.extraCss.
gtk = { gtk.enable = true;
enable = true; # gtk.gtk3.extraCss / gtk4.extraCss are no-ops once stylix owns the
gtk3.extraCss = '' # theme — extra CSS has to go through stylix.targets.gtk.extraCss.
headerbar { min-height: 0; padding: 0; margin: 0; } stylix.targets.gtk.extraCss = ''
headerbar .title { font-size: 0; }
'';
gtk4.extraCss = ''
headerbar { min-height: 0; padding: 0; margin: 0; } headerbar { min-height: 0; padding: 0; margin: 0; }
headerbar .title { font-size: 0; } headerbar .title { font-size: 0; }
window:backdrop { window:backdrop {
@ -78,7 +75,6 @@
color: @headerbar_fg_color; color: @headerbar_fg_color;
} }
''; '';
};
# GNOME dconf settings — stylix owns colour-scheme, gtk-theme, # GNOME dconf settings — stylix owns colour-scheme, gtk-theme,
# cursor-theme and accent-color now. # cursor-theme and accent-color now.