Yaru dark variant

Hello everyone,

the dark theme of yaru is already used by several apps by default like eye of gnome, totem or can be selected within the app like in gnome todo, gnome builder or in rhythmbox (via the csd plugin):



Yaru-dark as a stand-alone theme which could be selected manually in gnome-tweaks much like adwaita dark, is generally demanded here in the big thread and recently also on github https://github.com/ubuntu/yaru/issues/7321

If you are in a developer environment and manually build the theme with meson, you can simply make all yaru dark by setting

$variant: 'dark'; 

in gtk.scss https://github.com/ubuntu/yaru/blob/master/gtk/src/gtk-3.0/gtk.scss#L7

But to produce/build two versions (yaru and yaru-dark) out of the scss files someone with better meson skills than me/carlo would somehow need to make meson build 1) yaru like always and then 2) build yaru-dark with variant: dark

That is the information from my side, here are questions from @didrocks which I try to answer right here :

what is the state of gtk applications with dark theme (2 and 3) compared to the light variant?

The dark variant for GTK3 is 100% ready and as complete as the light variant, the GTK2 version is non-existant but most people agreed over on github that this would be tolerable

how do you turn the dark variant on?

Currently either by the above mentioned method if one is using meson to build it manually or by setting
[Settings]
gtk-application-prefer-dark-theme=1 in ~/.config/gtk-3.0/settings.ini

what is the plan for documentation?

I am not sure what to answer, since the dark.css is build by selecting all the colors in _colors.scss which have a dedicated dark color for example

$light: if($variant=='light', true, false);
$base_color: if($variant == 'light', #FFFFFF, $inkstone);
$bg_color: if($variant == 'light', #F5F6F7, darken($inkstone, 3%));
$fg_color: if($variant == 'light', $inkstone, $porcelain);
$text_color: if($variant == 'light', #2D2D2D, $porcelain);

I know that GTK wanted to remove the dark variant support (I have already mentioned it), did anyone working on that variant have reached out upstream?

I don’t think anyone of us talked with upstream about the dark version.
What I know is, that some applications in gnome now use the dark theme automatically when the nightmode is applied. (but I don’t know if this already happening in 3.30 or if it was just a preview I saw)
Edit: gnome builder 3.28 is already using this feature

So, it would be great if we can make this happen in the next 2? or 3? days before UI freeze.

2 Likes

@merlijn-sebrechts :wink:

1 Like

To sum up the current situation:

  • we have a good GTK3 dark variant support. This one is shipped as well in the Yaru team for applications requesting the dark themes, like gnome-boxes, eye of GNOME, and so on…
  • the GTK2 dark variant isn’t merged yet. @c-lobrano is looking at excellent @mozit’s work but it seems that some more polish will be required to have it merged in Yaru itself. This is important for not GTK2 application itself, but also, as all Qt applications will be themed by it (like VLC).

Consequently:

  • As told, GTK3 applications in Yaru requesting a dark theme will have it themed with the dark version accordingly.
  • The Yaru github repo has support to build a Dark flavor (https://github.com/ubuntu/yaru/pull/816). However, as this isn’t complete (due to GTK2/Qt), we don’t ship it in the snap or deb, for support reason (some users would surely ask why VLC or thunderbird are using a light theme when the dark theme is selected). However, motivated users can build and use it directly, selecting “Yaru-dark” theme :wink:
  • This support also simplifies the GTK2 support once needed: it’s only a question of dropping a folder + uncommenting one line. So we are all ready once the GTK2 dark theme is almost there.

If the community wants to help on making the GTK2 dark theme a reality, I think there may still be a chance to ship it in the coming 2 weeks in cosmic, as an UI Freeze Exception (FreezeExceptionProcess - Ubuntu Wiki) should be easily granted (as no documentation or default screenshot are traditionally changing theme, the default being Yaru and not Yaru-dark), so this are still some potential good news if you want to help us!

6 Likes