Skip to content

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
rose-pine:mainfrom
AdrianColaianni:main
Open

Fix inverted gtk-dark.css in dark variants turning apps light when dark mode is requested#53
AdrianColaianni wants to merge 1 commit into
rose-pine:mainfrom
AdrianColaianni:main

Conversation

@AdrianColaianni

Copy link
Copy Markdown

Problem

The gtk-dark.css files shipped with the two dark variants (rose-pine-gtk and
rose-pine-moon-gtk) are color-inverted versions of the theme: the dark palette
was swapped into a light one (e.g. theme_bg_color is #f0f0f3 instead of
#191724/#1f1d2e).

gtk-dark.css is the stylesheet GTK3 loads whenever an application requests the
dark variant — via gtk-application-prefer-dark-theme=true in settings.ini,
GTK_THEME=rose-pine-gtk:dark, or apps that enable it at runtime when the
desktop 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.css an exact copy of dist/gtk.css for both dark variants, in
both the gtk-3.0 and gtk-3.20 trees, and rebuilds the corresponding
gtk.gresource bundles (the top-level gtk-dark.css files @import from the
compiled resource, so the bundles must match).

rose-pine-dawn-gtk is intentionally left unchanged: it is a light theme, so
having a dark gtk-dark.css is semantically correct.

Files changed

  • gtk3/rose-pine-gtk/gtk-3.0/dist/gtk-dark.css + rebuilt gtk.gresource
  • gtk3/rose-pine-gtk/gtk-3.20/dist/gtk-dark.css + rebuilt gtk.gresource
  • gtk3/rose-pine-moon-gtk/gtk-3.0/dist/gtk-dark.css + rebuilt gtk.gresource
  • gtk3/rose-pine-moon-gtk/gtk-3.20/dist/gtk-dark.css + rebuilt gtk.gresource

How to reproduce / verify

Before (theme installed, on any GTK3 app or a bare GtkWindow):

GTK_THEME=rose-pine-gtk:dark gtk3-widget-factory   # renders LIGHT

After this fix the same command renders the proper rose-pine dark palette
(#1f1d2e window background). Verified by reading dist/gtk-dark.css back out
of the rebuilt gresource bundles and by rendering a GtkWindow with the dark
variant forced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant