Files
ricing/gtk-3.0/gtk.css
nico 823277f535 Switch file manager to Thunar, fix GTK3 theming from the ground up
Dolphin's selection color is stuck on stock Breeze blue outside a full
Plasma session (unfixed upstream regression, see README) - dropped it
for Thunar. Getting Thunar themed exposed a chain of GTK3-specific
issues fixed along the way: !important is silently rejected by GTK3's
CSS parser (not just deprioritized), the widget and icon themes resolve
via completely different mechanisms under Hyprland (no XSETTINGS
daemon), and Thunar's ExoIconView grid reads its selection color from a
named @define-color instead of normal :selected matching. Folder icon
colors are now generated to match the accent exactly (theme/icon_theme.py,
no sudo) instead of snapping to a papirus-folders preset.

Also adds the kde-colorscheme template (the missing piece
KColorSchemeManager actually resolves ColorScheme= against) and new
gtk_selection_color/gtk_selection_opacity palette keys with widget
controls, following the existing bar/pill/popup color+opacity pattern.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
2026-09-29 01:19:42 +02:00

74 lines
2.2 KiB
CSS

/* Generated by theme/render.py from the active palette.
Edit the template at ~/.config/theme/templates/gtk3/gtk.css, not the output.
Blanket GTK3 override (applies to every GTK3 app: Thunar, Qalculate-gtk, etc.) - GSettings
(set in hyprland.lua's config.reloaded hook) picks the base Materia-dark theme, this then
forces the actual colors on top of it to match the palette.
No !important: GTK3's CSS parser doesn't support it at all (not "lower priority" -
it drops the whole declaration, "Junk at end of value" in GTK_DEBUG output). This file
is loaded at GTK_STYLE_PROVIDER_PRIORITY_USER, already above the theme's own CSS, so
plain declarations here win without it. */
* {
color: #c0caf5;
}
window, dialog, grid {
background-color: #1a1b26;
background-image: none;
}
entry, textview, textview text, text {
background-color: #1a1b26;
color: #1793d1;
border: 1px solid #1793d1;
border-radius: 6px;
box-shadow: none;
}
button {
background-color: #1a1b26;
background-image: none;
border: 1px solid #565f89;
border-radius: 6px;
box-shadow: none;
}
button:hover {
background-color: #565f89;
border-color: #1793d1;
}
button label {
color: #c0caf5;
}
button:hover label {
color: #1793d1;
}
/* Thunar's grid is ExoIconView, an old custom widget that doesn't ask the style
context "what's my background for :selected" through normal CSS matching - it
looks up these named colors directly instead (gtk_style_context_lookup_color).
Redefining them is what actually recolors the selection there; .view:selected/
*:selected below do nothing for it, only for widgets that DO use normal matching. */
@define-color theme_selected_bg_color alpha(#7aa2f7, 0.5);
@define-color theme_selected_fg_color #c0caf5;
@define-color theme_unfocused_selected_bg_color alpha(#7aa2f7, 0.5);
@define-color theme_unfocused_selected_fg_color #c0caf5;
/* File-manager icon/list view (Thunar's grid, Materia's rounded selection pill) */
.view {
background-color: transparent;
color: #c0caf5;
}
.view:hover {
background-color: alpha(#1793d1, 0.18);
}
*:selected {
background-color: alpha(#7aa2f7, 0.5);
color: #c0caf5;
}