-
Notifications
You must be signed in to change notification settings - Fork 188
#3 Yaru theme suite workflow and guidelines
The Yaru GTK themes are based on the upstream Adwaita Gtk theme and the Yaru GNOME Shell is theme based on the upstream GNOME shell theme. Those two upstream themes are not static and change over time because they belong to the gnome toolkit and the gnome shell, which's code also developes over time - so it is really important for a distribution that runs the GNOME desktop to keep the themes and the toolkit totally synced.
The current upstream Gtk Theme consists of the following SCSS source files, which are then linked together and converted to regular gtk.css light theme and a gtk-dark.css dark theme:
- _colors.scss contains all global color variables, for example the background colors, the foreground colors, the accent colors
- _drawing.scss contains all SCSS functions and mixins which are used for widgets that need to be styled very often in different hierarchies but always looking the same
- _common.scss is the biggest file and it contains global metric variables but most importantly the styling for all widgets in gtk including deep hierarchies and special cases, most of the time it uses the mixins and functions from _drawing.scss
The current upstream gnome-shell theme consists of _colors.scs which includes the upstream palette and all global colours for the theme, _common.scss which contains either the styling of widgets or links to a different file in ./widgets, _drawing.scss which contains the mixins and a lot of widget SCSS files in the widgets subdirectory.
- Latest changes in the upstream themes are tracked via GitHub Actions which create pull requests when upstream has new changes, to merge them into the dedicated upstream directories for gtk and gnome-shell.
- Because we have small differences from upstream we can not just copy paste the changes into the gtk and gnome-shell directories. Thus we need to create separate branches based on the branches GitHub action uses: upstream-gtk-update for an update to our Gtk theme and upstream-gnome-shell-update for an update to our gnome shell theme.
- For an update to the gtk theme we then copy all scss files from the gtk upstream directory into our gtk src directory.
- Now we need to keep the changes which are marked with a "Yaru change: ..." comment and accept all other changes from upstream.
- Do NOT change our _colors.scss file at all, either upstream uses a new variable here
- For an update to our gnome shell theme we need to copy all SCSS files from
gnome-shell/upstream/gnome-shell-sass
intognome-shell/src/gnome-shell-sass
. Accept all changes from upstream, but keep all changes that are marked with a "Yaru change: ..." comment.
There are certain details which we change in Yaru because we either found a styling mistake in the upstream code or because we simply disagree on a styling from upstream.
Current differences in the Yaru Gtk theme from upstream:
- we removed the gradients, text shadow and the top highlights from _drawing.scss for buttons, check/radios and the headerbar
- we increased the contrast of buttons by lightening them up by about 4%
- we use another SCSS file (_headbar.scss) for a special color variant of the theme which uses light backgrounds and dark text except for the headerbar where a dark background and light text is used - currently it is not possible to make this happen with the upstream theme
- we use _apps.scss for all app specific changes, because gtk apps sometimes apply styling only if the global theme is Adwaita
- we use _tweaks.scss for all changes on top of upstream, so if something goes wrong, we know where our changes are, and where the upstream changes are
Important: All of the changes are made with the least possible "diff" from upstream and responsibility in mind:
- Do not overwrite Gtk App developers styling classes - i.e. if the app developer wants to use the .flat style class, do not make it look like a regular button and vice versa
- Do not change the hierarchy of elements as this might cause ugly bugs
- Basically: do not change anything except the basic colors
Here are three basic rules to achieve this:
- Do not touch
_common.scss
after we merged upstream changes into our code except the smaller border-radius. - Try to avoid changes to
_drawing.scss
after we merged upstream changes into it - If we want to diverge from upstream, either because our palette (orange ;)) does not work in a certain place, or we disagree heavily with a design, we put this into
_tweaks.scss