Skip to content
This repository was archived by the owner on Jan 3, 2022. It is now read-only.

Commit 7583a57

Browse files
authored
Merge pull request #68 from csalmeida/v4.0.8
V4.0.8
2 parents 68df1dc + d8ac06c commit 7583a57

File tree

96 files changed

+2919
-17669
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+2919
-17669
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ Check out some of the available themes you can choose from.
100100

101101
![Screenshot of Gruvbox theme.](screenshots/gruvbox_full.png)
102102

103-
#### [Inbox](themes/inbox)
104-
![Screenshot of Inbox theme.](screenshots/inbox.png)
105-
106103
### [Nord](themes/nord)
107104
![Screenshot of Nord theme.](screenshots/nord.png)
108105

docker-compose.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ services:
1313
restart: always
1414
volumes:
1515
# Allows changes made to project directory to be accessed by the container and persist.
16-
- .:/var/projects/protonmail-themes
16+
- ./templates:/var/projects/protonmail-themes/templates
17+
- ./themes:/var/projects/protonmail-themes/themes
1718
# Adds a volume to store node dependencies.
18-
- /var/projects/protonmail-themes/node_modules
19+
- /var/projects/protonmail-themes/node_modules

docs/README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Documentation
22

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.
44

55
<details>
66
<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
1919
</details>
2020

2121
## Quick Setup Guide
22+
2223
> **Required for theme creation only**
2324
2425
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
2829
npm install
2930
```
3031

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.
3233

3334
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):
3435

@@ -56,26 +57,28 @@ npm run build
5657
## Creating a theme
5758

5859
Themes can be created in `/templates` and should be contained on a folder with the same name of the theme. For instance:
60+
5961
```
6062
/templates
6163
/new_theme
6264
/new_theme.scss
6365
```
6466

6567
After creating your theme folder and file, `new_theme.scss` should look similar to this snippet:
68+
6669
```scss
6770
/*! =========================================== *
6871
* Template THEME
69-
* Version: #{$version}
72+
* Version: #{info.$version}
7073
* Author: You name here
7174
* Website: Your website here
7275
* Tweets Your twitter handle
7376
* =========================================== */
7477

7578
// Change colors here and they will change everywhere.
76-
$base: #1C1C1C;
79+
$base: #1c1c1c;
7780
$search: #000;
78-
$highlight: #2FBF71;
81+
$highlight: #2fbf71;
7982
$navigation: #fff;
8083

8184
$text_color: #0d0d0d;
@@ -84,19 +87,20 @@ $danger_color: #d62646;
8487
$warning_color: #ffaa00;
8588

8689
@import "../@theme-base/styles";
87-
@import "../@theme-base/dark_mode";
8890

8991
// Please do not remove the imports above, add overrides and other partials below this line.
9092
```
9193

9294
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.
9395

9496
## Themes
97+
9598
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.
9699

97-
These themes are compiled from `.scss` templates into a final `.css`.
100+
These themes are compiled from `.scss` templates into a final `.css`.
98101

99102
## Templates
103+
100104
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.
101105

102106
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
105109

106110
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.
107111

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.
109113

110114
## Theme Compilation
111115

@@ -122,11 +126,13 @@ npm run build
122126
```
123127

124128
# 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.
126131

127132
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`.
128133

129134
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.
130135

131136
# 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.

docs/theme-templates-guide.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
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.
66

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`.
88

99
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.
1010

@@ -13,12 +13,13 @@ Feel free to extend and adapt this template to your needs by creating an `_overr
1313
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).
1414

1515
### 1. Setting color palette
16+
1617
Decide at least four colors you would like to use in your theme, then replace the `hex` values on the following variables:
1718

1819
```scss
19-
$base: #1C1C1C;
20+
$base: #1c1c1c;
2021
$search: #000;
21-
$highlight: #2FBF71;
22+
$highlight: #2fbf71;
2223
$navigation: #fff;
2324
```
2425

@@ -27,6 +28,7 @@ Each variable applies to a certain area of the UI. The `$base` color changes the
2728
> [Coolors is a good tool to create a palette](https://coolors.co/) if you're unsure of which colors to use!
2829
2930
#### (Optional) Changing other variables
31+
3032
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).
3133

3234
```scss
@@ -37,11 +39,13 @@ $warning_color: #ffaa00;
3739
```
3840

3941
### 2. Compiling the template from SASS into a CSS theme
42+
4043
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.
4144

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`.
4346

4447
### 3. (Optional) Extending you theme.
48+
4549
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/`:
4650

4751
```bash
@@ -60,10 +64,9 @@ Override styles will be scoped to your theme only. The [Ochin theme can be consu
6064
// Color variables here...
6165

6266
@import "../@theme-base/styles";
63-
@import "../@theme-base/dark_mode";
6467

6568
// Please do not remove the imports above, add overrides and other partials below this line.
66-
@import 'override';
69+
@import "override";
6770
```
6871

6972
In `_override.scss` add the styles specific to your theme:
@@ -81,4 +84,5 @@ In `_override.scss` add the styles specific to your theme:
8184
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.
8285

8386
### 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.

docs/theme-versioning.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
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:
44

55
```scss
6-
$version: 'v4.0.0-beta15';
6+
$version: "v4.0.0-beta15";
77
```
88

99
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:
1010

1111
```scss
12-
@import "../@theme-base/version";
12+
@use "../@theme-base/version" as info;
1313

1414
/*! =========================================== *
1515
* SLICK THEME
16-
* Version: #{$version}
16+
* Version: #{info.$version}
1717
* Author: ProtonMail
1818
* Website: www.protonmail.com
1919
* Twitter: @protonmail
@@ -35,12 +35,12 @@ Will compile to:
3535
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:
3636

3737
```scss
38-
@import "../@theme-base/version";
38+
@use "../@theme-base/version" as info;
3939
$version: "v4.0.0-beta3";
4040

4141
/*! =========================================== *
4242
* SLICK THEME
43-
* Version: #{$version}
43+
* Version: #{info.$version}
4444
* Author: ProtonMail
4545
* Website: www.protonmail.com
4646
* Twitter: @protonmail

screenshots/inbox.png

-354 KB
Binary file not shown.

0 commit comments

Comments
 (0)