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 • 4.95 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/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.

Changing the color scheme with script

To easily change the color scheme, you can use the change_color.sh script (or just use the oomox app).

Originally change_color.sh (and the scripts/ dir) was implemented for oomox, but you can also run it on the command line without oomox like this:

Note: This script only supports GTK2 and GTK3 for now.

For bash:

./change_color.sh -o my-test-theme <(echo -e "BG=F5F5F5\nFG=000000\nMENU_BG=FFFFFF\nMENU_FG=000000\nSEL_BG=42A5F5\nSEL_FG=FFFFFF\nTXT_BG=FFFFFF\nTXT_FG=000000\nBTN_BG=FAFAFA\nBTN_FG=000000\nACCENT_BG=FF4081\n")

For fish:

./change_color.sh -o my-test-theme (echo -e "BG=F5F5F5\nFG=000000\nMENU_BG=FFFFFF\nMENU_FG=000000\nSEL_BG=42A5F5\nSEL_FG=FFFFFF\nTXT_BG=FFFFFF\nTXT_FG=000000\nBTN_BG=FAFAFA\nBTN_FG=000000\nACCENT_BG=FF4081\n" | psub)

Useful Links

Upstream theme sources

For other upstream theme sources of apps/DEs, see the comments in the source code.

Tips

                
                    
1
## Summary
2
3
- Do not edit the CSS directly, edit the source SCSS files and run `./parse-sass.sh`
4
- To be able to use the latest/adequate version of Sass, install `sassc`
5
- To change the SVG assets color, use a text editor instead of a image editor
6
7
## How to tweak the theme
8
9
Like the upstream Adwaita, this theme is written and processed in Sass.
10
11
You can read about Sass at http://sass-lang.com/documentation/. Once you make
12
your changes to the SCSS files, run the `./parse-sass.sh` script to rebuild the
13
CSS files.
14
15
Here's a rundown of the _supporting_ stylesheets:
16
17
- `_variables.scss`
18
19
variables to allow easier definition of widget sizing/styling.
20
21
- `_color-palette.scss`
22
23
material design color palette definitions. We don't recommend editing this
24
unless Google updates the color scheme.
25
26
- `_colors.scss`
27
28
global color definitions. We keep the number of defined colors to a necessary
29
minimum. It covers both the light variant and the dark variant.
30
31
- `_colors-public.scss`
32
33
SCSS colors exported through gtk to allow for 3rd party apps color mixing.
34
35
- `_drawing.scss`
36
37
drawing helper mixings/functions to allow easier definition of widget drawing
38
under specific context.
39
40
- `_common.scss`
41
42
actual definitions of style for each widget. This is where you are likely to
43
add/remove your changes.
44
45
- `_apps.scss` or `_extensions.scss`
46
47
app/extension specific stylings.
48
49
## How to change the assets color
50
51
To keep it maintainable, SVG files are basically edited on text-based.
52
53
So if you just want to change the SVG assets color, we recommend using a
54
**text editor** instead of **Inkscape**. However, please note that Inkscape is
55
required to render the PNG assets from the SVG files.
56
57
Here's an example to change the _accent color_:
58
59
1. Open the following SVG files with a **text editor**.
60
61
- `./src/gtk-2.0/assets.svg`
62
- `./src/gtk-2.0/assets-dark.svg`
63
- `./src/gtk/assets.svg`
64
- `./src/gnome-shell/3.18/assets/checkbox.svg`
65
- `./src/gnome-shell/3.18/assets/more-results.svg`
66
- `./src/gnome-shell/3.18/assets/toggle-on.svg`
67
- `./src/gnome-shell/3.18/assets-dark/checkbox.svg`
68
- `./src/gnome-shell/3.18/assets-dark/more-results.svg`
69
- `./src/gnome-shell/3.18/assets-dark/toggle-on.svg`
70
71
2. Search `#FF4081` (default accent color) and replace with your favorite color.
72
73
> The recommended color palette is: https://material.io/guidelines/style/color.html#color-color-palette
74
75
3. Run `./render-assets.sh` to render the PNG assets for gtk2 and gtk3.
76
77
> Note: `inkscape` and `optipng` must be installed to run the script.
78
79
## Changing the color scheme with script
80
81
To easily change the color scheme, you can use the `change_color.sh` script (or
82
just use the [oomox](https://github.com/actionless/oomox) app).
83
84
Originally `change_color.sh` (and the `scripts/` dir) was implemented for oomox,
85
but you can also run it on the command line without oomox like this:
86
87
> Note: This script only supports GTK2 and GTK3 for now.
88
89
For `bash`:
90
91
```bash
92
./change_color.sh -o my-test-theme <(echo -e "BG=F5F5F5\nFG=000000\nMENU_BG=FFFFFF\nMENU_FG=000000\nSEL_BG=42A5F5\nSEL_FG=FFFFFF\nTXT_BG=FFFFFF\nTXT_FG=000000\nBTN_BG=FAFAFA\nBTN_FG=000000\nACCENT_BG=FF4081\n")
93
```
94
95
For `fish`:
96
97
```fish
98
./change_color.sh -o my-test-theme (echo -e "BG=F5F5F5\nFG=000000\nMENU_BG=FFFFFF\nMENU_FG=000000\nSEL_BG=42A5F5\nSEL_FG=FFFFFF\nTXT_BG=FFFFFF\nTXT_FG=000000\nBTN_BG=FAFAFA\nBTN_FG=000000\nACCENT_BG=FF4081\n" | psub)
99
```
100
101
## Useful Links
102
103
#### Upstream theme sources
104
105
- [GTK+ 4.0](https://github.com/GNOME/gtk/tree/master/gtk/theme/Adwaita)
106
- [3.22](https://github.com/GNOME/gtk/tree/gtk-3-22/gtk/theme/Adwaita)
107
- [3.20](https://github.com/GNOME/gtk/tree/gtk-3-20/gtk/theme/Adwaita)
108
- [3.18](https://github.com/GNOME/gtk/tree/gtk-3-18/gtk/theme/Adwaita)
109
- [GTK+ 2](https://github.com/GNOME/gnome-themes-standard/tree/master/themes/Adwaita/gtk-2.0)
110
- [GNOME Shell](https://github.com/GNOME/gnome-shell/tree/master/data/theme)
111
- [Sass sources](https://github.com/GNOME/gnome-shell-sass)
112
- [Metacity](https://github.com/GNOME/gnome-themes-standard/tree/gnome-3-14/themes/Adwaita/metacity-1) (legacy)
113
114
> For other upstream theme sources of apps/DEs, see the comments in the source code.
115
116
#### Tips
117
118
- [Material Design Guidelines](https://www.material.io/guidelines/)
119
- [CSS Guidelines for Materia](https://github.com/nana-4/materia-theme/wiki/CSS-Guidelines)
120
- [The GTK+ Inspector](https://blog.gtk.org/2017/04/05/the-gtk-inspector/)
121
- [Theming in GTK+ 4](https://developer.gnome.org/gtk4/stable/theming.html)
122
- [Theming in GTK+ 3](https://developer.gnome.org/gtk3/stable/theming.html)
123
- [GTK+ 2 Theming Tutorial](https://wiki.gnome.org/Attic/GnomeArt/Tutorials/GtkThemes)
124
- [The Pixmap Engine](https://wiki.gnome.org/Attic/GnomeArt/Tutorials/GtkEngines/PixmapEngine)
125
- [Designing Metacity Themes](https://wiki.gnome.org/Attic/GnomeArt/Tutorials/MetacityThemes)
126
- [Unity/Theming](https://wiki.ubuntu.com/Unity/Theming)
127
- [Xfwm4 theme how-to](https://wiki.xfce.org/howto/xfwm4_theme)
128
- [Chrome Themes](https://developer.chrome.com/extensions/themes)
129