Fix inverted gtk-dark.css in dark variants turning apps light when dark mode is requested#53
Open
AdrianColaianni wants to merge 1 commit into
Open
Fix inverted gtk-dark.css in dark variants turning apps light when dark mode is requested#53AdrianColaianni wants to merge 1 commit into
AdrianColaianni wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
gtk-dark.cssfiles shipped with the two dark variants (rose-pine-gtkandrose-pine-moon-gtk) are color-inverted versions of the theme: the dark palettewas swapped into a light one (e.g.
theme_bg_coloris#f0f0f3instead of#191724/#1f1d2e).gtk-dark.cssis the stylesheet GTK3 loads whenever an application requests thedark variant — via
gtk-application-prefer-dark-theme=trueinsettings.ini,GTK_THEME=rose-pine-gtk:dark, or apps that enable it at runtime when thedesktop reports
color-scheme=prefer-dark.The result is paradoxical: the more the system asks for dark mode, the more
these dark themes render light. Users end up with a light UI in GTK3 apps
despite having selected a dark theme and enabled prefer-dark.
Fix
For an already-dark theme, the dark variant is the theme itself. This PR makes
dist/gtk-dark.cssan exact copy ofdist/gtk.cssfor both dark variants, inboth the
gtk-3.0andgtk-3.20trees, and rebuilds the correspondinggtk.gresourcebundles (the top-levelgtk-dark.cssfiles@importfrom thecompiled resource, so the bundles must match).
rose-pine-dawn-gtkis intentionally left unchanged: it is a light theme, sohaving a dark
gtk-dark.cssis semantically correct.Files changed
gtk3/rose-pine-gtk/gtk-3.0/dist/gtk-dark.css+ rebuiltgtk.gresourcegtk3/rose-pine-gtk/gtk-3.20/dist/gtk-dark.css+ rebuiltgtk.gresourcegtk3/rose-pine-moon-gtk/gtk-3.0/dist/gtk-dark.css+ rebuiltgtk.gresourcegtk3/rose-pine-moon-gtk/gtk-3.20/dist/gtk-dark.css+ rebuiltgtk.gresourceHow to reproduce / verify
Before (theme installed, on any GTK3 app or a bare
GtkWindow):After this fix the same command renders the proper rose-pine dark palette
(
#1f1d2ewindow background). Verified by readingdist/gtk-dark.cssback outof the rebuilt gresource bundles and by rendering a GtkWindow with the dark
variant forced.