HACKING.md
ASCII text
Summary
Do not edit the CSS directly, edit the source SCSS files and run
./parse-sass.shTo be able to use the latest/adequate version of Sass, install
sasscDo not edit the PNG directly, edit the source SVG files and run
./render-assets.shTo be able to render the PNG assets, install
inkscapeandoptipngTo change the SVG assets color, use a text editor instead of a image editor
How to tweak the CSS/SCSS
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.scssor_extensions.scss
app/extension specific stylings.
How to change 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 the app as follows:
Note: This script doesn't support Chrome extensions for now.
For bash:
./change_color.sh -o Flat-Plat <(echo -e "BG=F5F5F5\nFG=212121\nTXT_BG=FFFFFF\nTXT_FG=212121\nBTN_BG=FAFAFA\nBTN_FG=616161\nMENU_BG=455A64\nMENU_FG=FFFFFF\nSEL_BG=42A5F5\nSEL_FG=FFFFFF\nACCENT_BG=FF4081\nMATERIA_STYLE_COMPACT=False\n")
For fish:
./change_color.sh -o Flat-Plat (echo -e "BG=F5F5F5\nFG=212121\nTXT_BG=FFFFFF\nTXT_FG=212121\nBTN_BG=FAFAFA\nBTN_FG=616161\nMENU_BG=455A64\nMENU_FG=FFFFFF\nSEL_BG=42A5F5\nSEL_FG=FFFFFF\nACCENT_BG=FF4081\nMATERIA_STYLE_COMPACT=False\n" | psub)
Manually
If you want to change the color scheme in more detail, edit the following files that define color:
src/_sass/_color-palette.scsssrc/_sass/_colors.scsssrc/chrome/chrome-scrollbar{,-dark}/icons/*.svgsrc/chrome/chrome-theme{,-dark,-light}/*.svgsrc/chrome/chrome-theme{,-dark,-light}/manifest.jsonsrc/gnome-shell/assets{,-dark}/*.svgsrc/gtk/assets.svgsrc/gtk-2.0/assets{,-dark}.svgsrc/gtk-2.0/gtkrc{,-dark,-light}src/metacity-1/metacity-theme-2{,-light}.xmlsrc/metacity-1/metacity-theme-3{,-light}.xmlsrc/unity/*.svgsrc/unity/assets{,-light}/*.svgsrc/xfwm4/assets{,-light}/*.svgsrc/xfwm4/assets{,-light}/themerc
NOTES:
To edit the colors of
.svgfiles, use a text editor instead of a image editor.After editing the colors of
.scssfiles, run./parse-sass.shto rebuild the CSS files.After editing the colors of
src/gtk/assets.svgandsrc/gtk-2.0/assets{,-dark}.svg, run./render-assets.shto render the PNG assets.The colors of
manifest.jsonare defined in RGB format, so you need to convert your colors from HEX format to RGB format.
After all the steps, run ./install.sh.
Useful Links
Upstream theme sources
GTK+ 4.0 (master)
Sass sources (legacy)
Metacity (legacy)
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
- Do not edit the PNG directly, edit the source SVG files and run `./render-assets.sh`
6
- To be able to render the PNG assets, install `inkscape` and `optipng`
7
- To change the SVG assets color, use a text editor instead of a image editor
8
9
## How to tweak the CSS/SCSS
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 color scheme
52
53
### With script
54
55
To easily change the color scheme, you can use the `change_color.sh` script (or
56
just use the [oomox](https://github.com/actionless/oomox) app).
57
58
Originally `change_color.sh` (and the `scripts/` dir) was implemented for oomox,
59
but you can also run it on the command line without the app as follows:
60
61
> Note: This script doesn't support Chrome extensions for now.
62
63
For `bash`:
64
65
```bash
66
./change_color.sh -o Flat-Plat <(echo -e "BG=F5F5F5\nFG=212121\nTXT_BG=FFFFFF\nTXT_FG=212121\nBTN_BG=FAFAFA\nBTN_FG=616161\nMENU_BG=455A64\nMENU_FG=FFFFFF\nSEL_BG=42A5F5\nSEL_FG=FFFFFF\nACCENT_BG=FF4081\nMATERIA_STYLE_COMPACT=False\n")
67
```
68
69
For `fish`:
70
71
```fish
72
./change_color.sh -o Flat-Plat (echo -e "BG=F5F5F5\nFG=212121\nTXT_BG=FFFFFF\nTXT_FG=212121\nBTN_BG=FAFAFA\nBTN_FG=616161\nMENU_BG=455A64\nMENU_FG=FFFFFF\nSEL_BG=42A5F5\nSEL_FG=FFFFFF\nACCENT_BG=FF4081\nMATERIA_STYLE_COMPACT=False\n" | psub)
73
```
74
75
### Manually
76
77
If you want to change the color scheme in more detail, edit the following files
78
that define color:
79
80
- `src/_sass/_color-palette.scss`
81
- `src/_sass/_colors.scss`
82
- `src/chrome/chrome-scrollbar{,-dark}/icons/*.svg`
83
- `src/chrome/chrome-theme{,-dark,-light}/*.svg`
84
- `src/chrome/chrome-theme{,-dark,-light}/manifest.json`
85
- `src/gnome-shell/assets{,-dark}/*.svg`
86
- `src/gtk/assets.svg`
87
- `src/gtk-2.0/assets{,-dark}.svg`
88
- `src/gtk-2.0/gtkrc{,-dark,-light}`
89
- `src/metacity-1/metacity-theme-2{,-light}.xml`
90
- `src/metacity-1/metacity-theme-3{,-light}.xml`
91
- `src/unity/*.svg`
92
- `src/unity/assets{,-light}/*.svg`
93
- `src/xfwm4/assets{,-light}/*.svg`
94
- `src/xfwm4/assets{,-light}/themerc`
95
96
NOTES:
97
98
- To edit the colors of `.svg` files, use a text editor instead of a image editor.
99
- After editing the colors of `.scss` files, run `./parse-sass.sh` to rebuild the CSS files.
100
- After editing the colors of `src/gtk/assets.svg` and `src/gtk-2.0/assets{,-dark}.svg`, run `./render-assets.sh` to render the PNG assets.
101
- The colors of `manifest.json` are defined in RGB format, so you need to convert your colors from HEX format to RGB format.
102
103
After all the steps, run `./install.sh`.
104
105
## Useful Links
106
107
#### Upstream theme sources
108
109
- [GTK+ 4.0](https://gitlab.gnome.org/GNOME/gtk/tree/master/gtk/theme/Adwaita) (master)
110
- [3.22](https://gitlab.gnome.org/GNOME/gtk/tree/gtk-3-22/gtk/theme/Adwaita)
111
- [3.20](https://gitlab.gnome.org/GNOME/gtk/tree/gtk-3-20/gtk/theme/Adwaita)
112
- [3.18](https://gitlab.gnome.org/GNOME/gtk/tree/gtk-3-18/gtk/theme/Adwaita)
113
- [GTK+ 2](https://gitlab.gnome.org/GNOME/gnome-themes-extra/tree/master/themes/Adwaita/gtk-2.0)
114
- [GNOME Shell](https://gitlab.gnome.org/GNOME/gnome-shell/tree/master/data/theme)
115
- [Sass sources](https://github.com/GNOME/gnome-shell-sass) (legacy)
116
- [Metacity](https://gitlab.gnome.org/GNOME/gnome-themes-extra/tree/gnome-3-14/themes/Adwaita/metacity-1) (legacy)
117
118
> For other upstream theme sources of apps/DEs, see the comments in the source code.
119
120
#### Tips
121
122
- [Material Design Guidelines](https://www.material.io/guidelines/)
123
- [CSS Guidelines for Materia](https://github.com/nana-4/materia-theme/wiki/CSS-Guidelines)
124
- [The GTK+ Inspector](https://blog.gtk.org/2017/04/05/the-gtk-inspector/)
125
- [Theming in GTK+ 4](https://developer.gnome.org/gtk4/stable/theming.html)
126
- [Theming in GTK+ 3](https://developer.gnome.org/gtk3/stable/theming.html)
127
- [GTK+ 2 Theming Tutorial](https://wiki.gnome.org/Attic/GnomeArt/Tutorials/GtkThemes)
128
- [The Pixmap Engine](https://wiki.gnome.org/Attic/GnomeArt/Tutorials/GtkEngines/PixmapEngine)
129
- [Designing Metacity Themes](https://wiki.gnome.org/Attic/GnomeArt/Tutorials/MetacityThemes)
130
- [Unity/Theming](https://wiki.ubuntu.com/Unity/Theming)
131
- [Xfwm4 theme how-to](https://wiki.xfce.org/howto/xfwm4_theme)
132
- [Chrome Themes](https://developer.chrome.com/extensions/themes)
133