You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 3, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: docs/README.md
+16-10Lines changed: 16 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Documentation
2
2
3
-
A breakdown of how the project works, and details on how themes are generated and now to create new ones.
3
+
A breakdown of how the project works, and details on how themes are generated and now to create new ones.
4
4
5
5
<details>
6
6
<summary>Click to show available documentation</summary>
@@ -19,6 +19,7 @@ A breakdown of how the project works, and details on how themes are generated a
19
19
</details>
20
20
21
21
## Quick Setup Guide
22
+
22
23
> **Required for theme creation only**
23
24
24
25
Before making a contribution you might want to setup the project in order to test fixes and compile themes. Install NodeJS first and after forking/cloning this repository install the dependencies:
@@ -28,7 +29,7 @@ cd protonmail-themes
28
29
npm install
29
30
```
30
31
31
-
Themes can be created by duplicating and renaming the [example theme folder](../templates/theme_example) and its `.scss` file to the chosen theme name.
32
+
Themes can be created by duplicating and renaming the [example theme folder](../templates/theme_example) and its `.scss` file to the chosen theme name.
32
33
33
34
A theme name folder and file should be separared by undercores if it has more than one word and should be places in [`/templates/`](../templates):
34
35
@@ -56,26 +57,28 @@ npm run build
56
57
## Creating a theme
57
58
58
59
Themes can be created in `/templates` and should be contained on a folder with the same name of the theme. For instance:
60
+
59
61
```
60
62
/templates
61
63
/new_theme
62
64
/new_theme.scss
63
65
```
64
66
65
67
After creating your theme folder and file, `new_theme.scss` should look similar to this snippet:
68
+
66
69
```scss
67
70
/*! =========================================== *
68
71
* Template THEME
69
-
* Version: #{$version}
72
+
* Version: #{info.$version}
70
73
* Author: You name here
71
74
* Website: Your website here
72
75
* Tweets Your twitter handle
73
76
* =========================================== */
74
77
75
78
// Change colors here and they will change everywhere.
76
-
$base: #1C1C1C;
79
+
$base: #1c1c1c;
77
80
$search: #000;
78
-
$highlight: #2FBF71;
81
+
$highlight: #2fbf71;
79
82
$navigation: #fff;
80
83
81
84
$text_color: #0d0d0d;
@@ -84,19 +87,20 @@ $danger_color: #d62646;
84
87
$warning_color: #ffaa00;
85
88
86
89
@import"../@theme-base/styles";
87
-
@import"../@theme-base/dark_mode";
88
90
89
91
// Please do not remove the imports above, add overrides and other partials below this line.
90
92
```
91
93
92
94
The snippet will change the colors of the elements across the theme. However, you can extend or override the theme further by adding changes to `_override.scss`. Additionally, [custom partials can be added](https://sass-lang.com/guide). You can refer to [the guide on editing theme templates](./theme-templates-guide.md) for more information on customizing themes.
93
95
94
96
## Themes
97
+
95
98
Ready to use themes are stored at [`/themes`](../themes) and can be copied over to the Custom Theme text area avalaible at the `Appearance -> Themes` section on your ProtonMail settings. Each theme has it's own folder with one or more `.css` files in it. The text inside these `.css` files is what needs to be copied to the custom theme section in ProtonMail for the theme to be applied.
96
99
97
-
These themes are compiled from `.scss` templates into a final `.css`.
100
+
These themes are compiled from `.scss` templates into a final `.css`.
98
101
99
102
## Templates
103
+
100
104
The templates folder at [`/templates`](../templates) hold style rules for all the themes as well as their particular color palettes. All themes import their styles from the [`/@theme-base/_styles.scss`](../templates/@theme-base/_styles.scss) partial and this is the file that should be changed when fixing a bug in styling or adding styles to a newly introduced element in the UI.
101
105
102
106
In addition to [`_styles.scss`](../templates/@theme-base/_styles.scss), the [`/@theme-base/_full.scss`](../templates/@theme-base/_full.scss) will create a version of the theme where the base colour will be applied to further areas in the UI and can be used to have themes closer to a "dark mode" aesthetic.
@@ -105,7 +109,7 @@ Changes made in these two files will apply to all themes. Two `.css` files are c
105
109
106
110
Theme colors be changed in their template files and can be found inside in their theme template folder. For instance, to change the Green Lume theme, change the variables at `/template/gree_lume/green_lume.scss`. The color values applied to those variables will replicate across ProtonMail's UI when the theme is applied.
107
111
108
-
The [`/@theme-base`](../templates/@theme-base/) folder also includes two other folders with styling. These are [part of ProtonMail's Design System](https://github.com/ProtonMail/design-system/tree/master/_sass) and serve as a starting point to create the themes.
112
+
The [`/@theme-base`](../templates/@theme-base/) folder also includes two other folders with styling. These are [part of ProtonMail's Design System](https://github.com/ProtonMail/design-system/tree/master/_sass) and serve as a starting point to create the themes.
109
113
110
114
## Theme Compilation
111
115
@@ -122,11 +126,13 @@ npm run build
122
126
```
123
127
124
128
# Contributing
125
-
Everyone who is learning or already has a grasp of SASS and CSS is encouraged to contribute to the project. If you're applying a fix to `gulpfile.js` or any other files there's not set rules for now.
129
+
130
+
Everyone who is learning or already has a grasp of SASS and CSS is encouraged to contribute to the project. If you're applying a fix to `gulpfile.js` or any other files there's not set rules for now.
126
131
127
132
Most contributions are usually theme related and if you're thinking of making a pull request please change the respective `.scss` file in favor of the compiled stylesheet (in `/themes`) in order to make these changes permanent and available for everyone. Templates can be found at `/templates/@theme-base`.
128
133
129
134
If this is not clear please don't worry! Feel free to open a PR anyway and I'm happy to walk you through it.
130
135
131
136
# Is there something missing?
132
-
If your question wasn't addressed here please feel free open an issue.
137
+
138
+
If your question wasn't addressed here please feel free open an issue.
Copy file name to clipboardExpand all lines: docs/theme-templates-guide.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
There's a template provided at [`/templates/theme_example`](`../templates/theme_example`) that allows anyone that knows a bit a about `SCSS` to generate a theme.
6
6
7
-
This template does not style every single element of ProtonMail's UI and sticks to changing the `color` of elements rather than `position` or `font`.
7
+
This template does not style every single element of ProtonMail's UI and sticks to changing the `color` of elements rather than `position` or `font`.
8
8
9
9
Feel free to extend and adapt this template to your needs by creating an `_override.scss` file and adding new styles there, those styles will be scoped to your theme only. The [Ochin theme can be consulted as an example](../templates/ochin) of using overrides can be used on a theme.
10
10
@@ -13,12 +13,13 @@ Feel free to extend and adapt this template to your needs by creating an `_overr
13
13
Sass was used to enable users and contributors to create themes without having to create a stylesheet from scratch. In order to create a theme it will require [some knowledge of how variables work in Sass](http://sass-lang.com/guide).
14
14
15
15
### 1. Setting color palette
16
+
16
17
Decide at least four colors you would like to use in your theme, then replace the `hex` values on the following variables:
17
18
18
19
```scss
19
-
$base: #1C1C1C;
20
+
$base: #1c1c1c;
20
21
$search: #000;
21
-
$highlight: #2FBF71;
22
+
$highlight: #2fbf71;
22
23
$navigation: #fff;
23
24
```
24
25
@@ -27,6 +28,7 @@ Each variable applies to a certain area of the UI. The `$base` color changes the
27
28
> [Coolors is a good tool to create a palette](https://coolors.co/) if you're unsure of which colors to use!
28
29
29
30
#### (Optional) Changing other variables
31
+
30
32
There is another set of variables available that will change elements that tend to fall out of the groups defined earlier. This could include content boxes, warnings, or elements that usually show up on the Settings part of the app. Feel free to experiment changing these if you are looking for a bit more customization (for adding more to the theme you can also extend the template, we'll get to this later).
31
33
32
34
```scss
@@ -37,11 +39,13 @@ $warning_color: #ffaa00;
37
39
```
38
40
39
41
### 2. Compiling the template from SASS into a CSS theme
42
+
40
43
This project [includes a way of compiling themes using Gulp](./README.md#theme-compilation) but the way you do this is entirely up to you. You could do it through the command line, perhaps you use [Atom](https://atom.io/) and a plugin to compile your `.scss` files into CSS as you write them. Use [Webpack](https://webpack.js.org/) or [Sassmeister](https://www.sassmeister.com/). This project can compile your theme by running `npm run build`, provided that dependencies were installed.
41
44
42
-
Regardless of the way you choose to do this you should end up with a `theme_template.css`*not*`.scss`.
45
+
Regardless of the way you choose to do this you should end up with a `theme_template.css`_not_`.scss`.
43
46
44
47
### 3. (Optional) Extending you theme.
48
+
45
49
Editing the variables can create a decent theme but you might want to further develop it and style as many elements as you like. To further customize your theme, add the extra CSS to an `_override.scss` file and add additional styles there. The file should be in `/templates/you_theme/`:
46
50
47
51
```bash
@@ -60,10 +64,9 @@ Override styles will be scoped to your theme only. The [Ochin theme can be consu
60
64
// Color variables here...
61
65
62
66
@import"../@theme-base/styles";
63
-
@import"../@theme-base/dark_mode";
64
67
65
68
// Please do not remove the imports above, add overrides and other partials below this line.
66
-
@import'override';
69
+
@import"override";
67
70
```
68
71
69
72
In `_override.scss` add the styles specific to your theme:
@@ -81,4 +84,5 @@ In `_override.scss` add the styles specific to your theme:
81
84
Your theme will compile to CSS and can be found in `/themes/your_theme_name` by running the build task present in the [quick setup guide](README.md#quick-setup-guide), in the README.
82
85
83
86
### Final touches
84
-
Test your theme on ProtonMail and re-iterate as needed. If you think your theme is ready and *cool* you can submit a pull request and add it to this repo so everyone can use it.
87
+
88
+
Test your theme on ProtonMail and re-iterate as needed. If you think your theme is ready and _cool_ you can submit a pull request and add it to this repo so everyone can use it.
Copy file name to clipboardExpand all lines: docs/theme-versioning.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,17 +3,17 @@
3
3
In `templates/@theme-base/` there is a `_version.scss` partial. This partial includes a single line of code that aids in keeping the version of all themes up to date:
4
4
5
5
```scss
6
-
$version: 'v4.0.0-beta15';
6
+
$version: "v4.0.0-beta15";
7
7
```
8
8
9
9
This variable is used in all themes by default and it will print the current version when a theme is compiled. For example, this theme header:
10
10
11
11
```scss
12
-
@import"../@theme-base/version";
12
+
@use"../@theme-base/version"asinfo;
13
13
14
14
/*! =========================================== *
15
15
* SLICK THEME
16
-
* Version: #{$version}
16
+
* Version: #{info.$version}
17
17
* Author: ProtonMail
18
18
* Website: www.protonmail.com
19
19
* Twitter: @protonmail
@@ -35,12 +35,12 @@ Will compile to:
35
35
In some cases a theme might have a specific version it is compatible with. In that case the variable can be pointed to another version on the theme template file:
0 commit comments