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
sasscTo change the SVG assets color, use a text editor instead of a image editor
How to tweak the theme
Flat-Plat is a complex theme, so to keep it maintainable it's written and processed in Sass.
Here's a rundown of thesupporting stylesheets, that are unlikely to be the right place for a drive by stylesheet fix:
_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, most colors are derived from a handful of basics. 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.
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.
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. But please note that in some cases Inkscape is needed to render the PNG assets.
Here's an example to change the _accent color_:
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
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
For gtk2 and gtk3, delete all PNG assets before redrawing them.
sh
rm -v ./src/gtk-2.0/assets/*.png
rm -v ./src/gtk-2.0/assets-dark/*.png
rm -v ./src/gtk-3.0/gtk-common/assets/*.png
Run
./render-assets.shor./render-assets-dark.shto render the PNG assets.
> Note: Inkscape is required to run the scripts.
- for gtk2:
sh
cd ./src/gtk-2.0
./render-assets.sh
./render-assets-dark.sh
- for gtk3:
sh
cd ./src/gtk-3.0/gtk-common
./render-assets.sh
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
Flat-Plat is a complex theme, so to keep it maintainable it's written and
12
processed in Sass.
13
14
Here's a rundown of the _supporting_ stylesheets, that are unlikely to be the
15
right place for a drive by stylesheet fix:
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, most colors are derived from a handful of basics. It covers both the
30
light variant and the dark variant.
31
32
- `_colors-public.scss`
33
34
SCSS colors exported through gtk to allow for 3rd party apps color mixing.
35
36
- `_drawing.scss`
37
38
drawing helper mixings/functions to allow easier definition of widget drawing
39
under specific context.
40
41
- `_common.scss`
42
43
actual definitions of style for each widget. This is where you are likely to
44
add/remove your changes.
45
46
- `_apps.scss` or `_extensions.scss`
47
48
app/extension specific stylings.
49
50
You can read about Sass at http://sass-lang.com/documentation/. Once you make
51
your changes to the SCSS files, run the `./parse-sass.sh` script to rebuild the
52
CSS files.
53
54
How to change the assets color
55
------------------------------
56
57
To keep it maintainable, SVG files are basically edited on text-based.
58
59
So if you just want to change the SVG assets color, we recommend using a
60
**text editor** instead of **Inkscape**. But please note that in some cases
61
Inkscape is needed to render the PNG assets.
62
63
Here's an example to change the _accent color_:
64
65
1. Open the following SVG files with a **text editor**.
66
67
- `./src/gtk-2.0/assets.svg`
68
- `./src/gtk-2.0/assets-dark.svg`
69
- `./src/gtk-3.0/gtk-common/assets.svg`
70
- `./src/gnome-shell/3.18/assets/checkbox.svg`
71
- `./src/gnome-shell/3.18/assets/more-results.svg`
72
- `./src/gnome-shell/3.18/assets/toggle-on.svg`
73
- `./src/gnome-shell/3.18/assets-dark/checkbox.svg`
74
- `./src/gnome-shell/3.18/assets-dark/more-results.svg`
75
- `./src/gnome-shell/3.18/assets-dark/toggle-on.svg`
76
77
2. Search `#FF4081` (default accent color) and replace with your favorite color.
78
79
- The recommended color palette is: https://material.io/guidelines/style/color.html#color-color-palette
80
81
3. For gtk2 and gtk3, delete all PNG assets before redrawing them.
82
83
```sh
84
rm -v ./src/gtk-2.0/assets/*.png
85
rm -v ./src/gtk-2.0/assets-dark/*.png
86
rm -v ./src/gtk-3.0/gtk-common/assets/*.png
87
```
88
89
4. Run `./render-assets.sh` or `./render-assets-dark.sh` to render the PNG assets.
90
91
> Note: Inkscape is required to run the scripts.
92
93
- for gtk2:
94
95
```sh
96
cd ./src/gtk-2.0
97
./render-assets.sh
98
./render-assets-dark.sh
99
```
100
101
- for gtk3:
102
103
```sh
104
cd ./src/gtk-3.0/gtk-common
105
./render-assets.sh
106
```
107
108
Useful Links
109
------------
110
111
Upstream theme sources:
112
- [GTK+ 4](https://github.com/GNOME/gtk/tree/master/gtk/theme/Adwaita)
113
- [3.22](https://github.com/GNOME/gtk/tree/gtk-3-22/gtk/theme/Adwaita)
114
- [3.20](https://github.com/GNOME/gtk/tree/gtk-3-20/gtk/theme/Adwaita)
115
- [3.18](https://github.com/GNOME/gtk/tree/gtk-3-18/gtk/theme/Adwaita)
116
- [GTK+ 2](https://github.com/GNOME/gnome-themes-standard/tree/master/themes/Adwaita/gtk-2.0)
117
- [GNOME Shell](https://github.com/GNOME/gnome-shell/tree/master/data/theme)
118
- [Sass sources](https://github.com/GNOME/gnome-shell-sass)
119
120
Tips:
121
- [Unity/Theming](https://wiki.ubuntu.com/Unity/Theming)
122
- [Material Design Guidelines](https://www.material.io/guidelines/)
123
- [Personal CSS Guidelines](https://github.com/nana-4/Flat-Plat/wiki/CSS-Guidelines)
124