A fork of the Materia GTK theme.

Important information: Google announced that, from September 2026, Android devices will require ALL apps to be signed by Google, effectively leading to an iOS situation. Value your right to a computer that does what you want; do not tolerate this monopolistic practice! Contact me if you don't understand why it is bad. Click to learn more.

 HACKING.md

View raw Download
text/plain • 3.43 kiB
ASCII text

Summary

  • Do not edit the CSS directly, edit the source SCSS files and run ./parse-sass.sh

  • To be able to use the latest/adequate version of Sass, install sassc

  • To change the SVG assets color, use a text editor instead of a image editor

How to tweak the theme

Like the upstream Adwaita, this theme is written and processed in Sass.

You can read about Sass at http://sass-lang.com/documentation/. Once you make your changes to the SCSS files, run the ./parse-sass.sh script to rebuild the CSS files.

Here's a rundown of thesupporting stylesheets:

  • _variables.scss

variables to allow easier definition of widget sizing/styling.

  • _color-palette.scss

material design color palette definitions. We don't recommend editing this unless Google updates the color scheme.

  • _colors.scss

global color definitions. We keep the number of defined colors to a necessary minimum. It covers both the light variant and the dark variant.

  • _colors-public.scss

SCSS colors exported through gtk to allow for 3rd party apps color mixing.

  • _drawing.scss

drawing helper mixings/functions to allow easier definition of widget drawing under specific context.

  • _common.scss

actual definitions of style for each widget. This is where you are likely to add/remove your changes.

  • _apps.scss or _extensions.scss

app/extension specific stylings.

How to change the assets color

To keep it maintainable, SVG files are basically edited on text-based.

So if you just want to change the SVG assets color, we recommend using a text editor instead of Inkscape. However, please note that Inkscape is required to render the PNG assets from the SVG files.

Here's an example to change the _accent color_:

  1. Open the following SVG files with a text editor.

- ./src/gtk-2.0/assets.svg - ./src/gtk-2.0/assets-dark.svg - ./src/gtk-3.0/gtk-common/assets.svg - ./src/gnome-shell/3.18/assets/checkbox.svg - ./src/gnome-shell/3.18/assets/more-results.svg - ./src/gnome-shell/3.18/assets/toggle-on.svg - ./src/gnome-shell/3.18/assets-dark/checkbox.svg - ./src/gnome-shell/3.18/assets-dark/more-results.svg - ./src/gnome-shell/3.18/assets-dark/toggle-on.svg

  1. Search #FF4081 (default accent color) and replace with your favorite color.

> The recommended color palette is: https://material.io/guidelines/style/color.html#color-color-palette

  1. Run ./render-assets.sh to render the PNG assets for gtk2 and gtk3.

> Note: inkscape and optipng must be installed to run the script.

Useful Links

Upstream theme sources

Tips

                
                    
1
Summary
2
-------
3
4
- Do not edit the CSS directly, edit the source SCSS files and run `./parse-sass.sh`
5
- To be able to use the latest/adequate version of Sass, install `sassc`
6
- To change the SVG assets color, use a text editor instead of a image editor
7
8
How to tweak the theme
9
----------------------
10
11
Like the upstream Adwaita, this theme is written and processed in Sass.
12
13
You can read about Sass at http://sass-lang.com/documentation/. Once you make
14
your changes to the SCSS files, run the `./parse-sass.sh` script to rebuild the
15
CSS files.
16
17
Here's a rundown of the _supporting_ stylesheets:
18
19
- `_variables.scss`
20
21
variables to allow easier definition of widget sizing/styling.
22
23
- `_color-palette.scss`
24
25
material design color palette definitions. We don't recommend editing this
26
unless Google updates the color scheme.
27
28
- `_colors.scss`
29
30
global color definitions. We keep the number of defined colors to a necessary
31
minimum. It covers both the light variant and the dark variant.
32
33
- `_colors-public.scss`
34
35
SCSS colors exported through gtk to allow for 3rd party apps color mixing.
36
37
- `_drawing.scss`
38
39
drawing helper mixings/functions to allow easier definition of widget drawing
40
under specific context.
41
42
- `_common.scss`
43
44
actual definitions of style for each widget. This is where you are likely to
45
add/remove your changes.
46
47
- `_apps.scss` or `_extensions.scss`
48
49
app/extension specific stylings.
50
51
How to change the assets color
52
------------------------------
53
54
To keep it maintainable, SVG files are basically edited on text-based.
55
56
So if you just want to change the SVG assets color, we recommend using a
57
**text editor** instead of **Inkscape**. However, please note that Inkscape is
58
required to render the PNG assets from the SVG files.
59
60
Here's an example to change the _accent color_:
61
62
1. Open the following SVG files with a **text editor**.
63
64
- `./src/gtk-2.0/assets.svg`
65
- `./src/gtk-2.0/assets-dark.svg`
66
- `./src/gtk-3.0/gtk-common/assets.svg`
67
- `./src/gnome-shell/3.18/assets/checkbox.svg`
68
- `./src/gnome-shell/3.18/assets/more-results.svg`
69
- `./src/gnome-shell/3.18/assets/toggle-on.svg`
70
- `./src/gnome-shell/3.18/assets-dark/checkbox.svg`
71
- `./src/gnome-shell/3.18/assets-dark/more-results.svg`
72
- `./src/gnome-shell/3.18/assets-dark/toggle-on.svg`
73
74
2. Search `#FF4081` (default accent color) and replace with your favorite color.
75
76
> The recommended color palette is: https://material.io/guidelines/style/color.html#color-color-palette
77
78
3. Run `./render-assets.sh` to render the PNG assets for gtk2 and gtk3.
79
80
> Note: `inkscape` and `optipng` must be installed to run the script.
81
82
Useful Links
83
------------
84
85
#### Upstream theme sources
86
- [GTK+ 4.0](https://github.com/GNOME/gtk/tree/master/gtk/theme/Adwaita)
87
- [3.22](https://github.com/GNOME/gtk/tree/gtk-3-22/gtk/theme/Adwaita)
88
- [3.20](https://github.com/GNOME/gtk/tree/gtk-3-20/gtk/theme/Adwaita)
89
- [3.18](https://github.com/GNOME/gtk/tree/gtk-3-18/gtk/theme/Adwaita)
90
- [GTK+ 2](https://github.com/GNOME/gnome-themes-standard/tree/master/themes/Adwaita/gtk-2.0)
91
- [GNOME Shell](https://github.com/GNOME/gnome-shell/tree/master/data/theme)
92
- [Sass sources](https://github.com/GNOME/gnome-shell-sass)
93
94
#### Tips
95
- [Unity/Theming](https://wiki.ubuntu.com/Unity/Theming)
96
- [Material Design Guidelines](https://www.material.io/guidelines/)
97
- [Personal CSS Guidelines](https://github.com/nana-4/Flat-Plat/wiki/CSS-Guidelines)
98
- [The GTK+ Inspector](https://blog.gtk.org/2017/04/05/the-gtk-inspector/)
99