theme: better gtk css

This commit is contained in:
Aly Raffauf 2024-09-17 20:36:14 -04:00
parent 5ffd4dfc8b
commit c1198d6791
2 changed files with 49 additions and 56 deletions

View file

@ -4,9 +4,9 @@
config, config,
... ...
}: let }: let
cfg = config.ar.home.theme; cfg = config.ar.home;
in { in {
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.theme.enable {
home.packages = [ home.packages = [
pkgs.gnome.adwaita-icon-theme pkgs.gnome.adwaita-icon-theme
pkgs.liberation_ttf pkgs.liberation_ttf
@ -35,60 +35,56 @@ in {
}; };
}; };
stylix.targets.gtk.extraCss = '' stylix.targets.gtk.extraCss = builtins.concatStringsSep "\n" [
window.background { border-radius: ${toString cfg.borders.radius}; } (lib.optionalString (cfg.desktop.hyprland.enable || cfg.desktop.sway.enable) ''
window.background { border-radius: ${toString cfg.theme.borders.radius}; }
tooltip {
background-color: alpha(${config.lib.stylix.colors.withHashtag.base00}, ${builtins.toString config.stylix.opacity.popups});
border-radius: ${toString cfg.borders.radius};
border: 1px solid ${config.lib.stylix.colors.withHashtag.base0D};
color: white;
}
tooltip.background {
background-color: alpha(${config.lib.stylix.colors.withHashtag.base00}, ${builtins.toString config.stylix.opacity.popups});
border: 1px solid ${config.lib.stylix.colors.withHashtag.base0D};
}
${
lib.optionalString (config.stylix.polarity == "light") "
tooltip { tooltip {
&.background { background-color: alpha(${config.lib.stylix.colors.withHashtag.base05}, ${builtins.toString config.stylix.opacity.popups}); } background-color: alpha(${config.lib.stylix.colors.withHashtag.base00}, ${builtins.toString config.stylix.opacity.popups});
background-color: alpha(${config.lib.stylix.colors.withHashtag.base05}, ${builtins.toString config.stylix.opacity.popups}); border-radius: ${toString cfg.theme.borders.radius};
}" border: 1px solid ${config.lib.stylix.colors.withHashtag.base0D};
} color: white;
}
${ tooltip.background {
lib.strings.optionalString background-color: alpha(${config.lib.stylix.colors.withHashtag.base00}, ${builtins.toString config.stylix.opacity.popups});
cfg.gtk.hideTitleBar border: 1px solid ${config.lib.stylix.colors.withHashtag.base0D};
'' }'')
/* No (default) title bar on wayland */
headerbar.default-decoration {
/* You may need to tweak these values depending on your GTK theme */
border-radius: 0;
border: 0;
box-shadow: none;
font-size: 0;
margin-bottom: 50px;
margin-top: -100px;
min-height: 0;
padding: 0;
}
.titlebar, (lib.optionalString (
.titlebar .background (cfg.desktop.hyprland.enable || cfg.desktop.sway.enable) && (config.stylix.polarity == "light")
{ ) ''
border-radius: 0; tooltip {
} &.background { background-color: alpha(${config.lib.stylix.colors.withHashtag.base05}, ${builtins.toString config.stylix.opacity.popups}); }
background-color: alpha(${config.lib.stylix.colors.withHashtag.base05}, ${builtins.toString config.stylix.opacity.popups});
}'')
/* rm -rf window shadows */ (lib.optionalString cfg.theme.gtk.hideTitleBar ''
window.csd, /* gtk4? */ /* No (default) title bar on wayland */
window.csd decoration { /* gtk3 */ headerbar.default-decoration {
border-radius: 0; /* You may need to tweak these values depending on your GTK theme */
box-shadow: none; border-radius: 0;
} border: 0;
'' box-shadow: none;
} font-size: 0;
''; margin-bottom: 50px;
margin-top: -100px;
min-height: 0;
padding: 0;
}
.titlebar,
.titlebar .background
{
border-radius: 0;
}
/* rm -rf window shadows */
window.csd, /* gtk4? */
window.csd decoration { /* gtk3 */
border-radius: 0;
box-shadow: none;
}'')
];
}; };
} }

View file

@ -1,7 +1,4 @@
{ {pkgs, ...}: {
pkgs,
...
}: {
home = { home = {
homeDirectory = "/home/aly"; homeDirectory = "/home/aly";