Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Dark mode #660

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions assets/css/sk-bounce.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
--sk-color: #E0E0E0;
}

@media (prefers-color-scheme: dark) {
:root {
--sk-color: #000000;
}
}

/* Implementation */
.sk-bounce {
width: var(--sk-size);
Expand Down
81 changes: 33 additions & 48 deletions assets/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ body {
font-family: 'Source Sans Pro', 'Helvetica Neue', 'Arial', sans-serif;
font-size: 1.1em;
line-height: 1.8em;
color: var(--grey_darker);
background-color: var(--white);
color: var(--text);
background-color: var(--app-background);
margin: 0;
}

Expand All @@ -19,7 +19,7 @@ body {
height: 5px;

&-thumb {
background-color: var(--grey_light);
background-color: var(--scrollbar);
border-radius: 5px;
}
&-scrollbar-button {
Expand All @@ -32,7 +32,7 @@ div, header, select, a {
}

a {
color: var(--blue);
color: var(--main-blue);
text-decoration: none;

&:hover {
Expand Down Expand Up @@ -159,7 +159,8 @@ code {
font-size: 0.8em;
font-family: 'Liberation Mono', Monaco, Courier New, monospace;
white-space: nowrap;
background: var(--white_darker);
background: var(--solidbox-background);
color: var(--solidbox-text);
padding: 6px 6px 3px 6px;
border-radius: 2px;

Expand All @@ -170,23 +171,19 @@ code {

&.shell::before {
content: "$ ";
color: var(--grey_light);
color: var(--codebox-shell-sign);
}
}

.box--border--blue code {
background-color: var(--blue_lightest);
color: var(--blue_grey);
}
.box--solid--light code {
background-color: var(--white_darkest);
background-color: var(--solidbox-codebox-background);
}

/*****************************
* Boxes
*****************************/
.box {
border-radius: 2px;
border-radius: 4px;
margin: 34px 0;
padding: 24px;

Expand All @@ -207,8 +204,8 @@ code {

&--light {
@extend .box--solid;
background-color: var(--blue_lightest);
color: var(--blue_grey);
background-color: var(--solidbox-background);
color: var(--solidbox-text);
}
}

Expand All @@ -218,7 +215,7 @@ code {
padding-top: 10px;

&:before {
background-color: white;
background-color: var(--app-background);
font-weight: bold;
font-size: 1.4em;
// White 'border'
Expand All @@ -239,10 +236,10 @@ code {

&--blue {
@extend .box--border;
border-color: var(--blue_lighter);
border-color: var(--main-blue--light);

&:before {
color: var(--blue);
color: var(--main-blue);
}
}

Expand All @@ -263,13 +260,13 @@ code {
.verify {
&__box {
@extend .box--solid;
background-color: var(--blue);
background-color: var(--main-blue);
color: white;
}

&__button {
background-color: white;
color: var(--blue);
color: var(--main-blue);
border-radius: 2px;

&:hover {
Expand Down Expand Up @@ -325,8 +322,8 @@ code {
display: flex;
justify-content: center;
font-size: 20px;
background-color: var(--white_dark);
border-bottom: 1px solid var(--white_darkest);
background-color: var(--header);
border-bottom: 1px solid var(--background-separator);

&__lang {
height: 36px;
Expand All @@ -337,27 +334,15 @@ code {
height: 100%;
width: 100%;
padding: 5px 10px;
border: 1px solid var(--blue_light);
background-color: var(--header);
border: 1px solid var(--main-blue--light);
border-radius: 3px;
color: var(--blue);
background: none;
appearance: none;
color: var(--main-blue);

&:focus {
outline-color: var(--blue_light);
outline-color: var(--main-blue--light);
}
}

// Dropdown arrow
&:after {
content: "";
border: 5px solid transparent;
border-top-color: var(--grey_light);
position: relative;
right: 20px;
top: 18.5px;
pointer-events: none;
}
}

&__text {
Expand Down Expand Up @@ -419,7 +404,7 @@ code {
.status-dot {
width: 10px;
height: 10px;
background-color: var(--blue);
background-color: var(--main-blue);
vertical-align: middle;
position: relative;
top: -1px;
Expand Down Expand Up @@ -462,7 +447,7 @@ code {
.octicon__reply {
width: 16px;
height: 16px;
background-color: var(--blue);
background-color: var(--main-blue);
display: block;
}

Expand All @@ -482,13 +467,13 @@ code {
.pgIndex {
&__progress {
margin: 20px 0;
color: var(--blue);
color: var(--main-blue);
user-select: none;
display: flex;
line-height: 1.3em;

&__box {
border: 1px solid var(--blue);
border: 1px solid var(--main-blue);
padding: 10px 14px;
display: inline;

Expand Down Expand Up @@ -516,7 +501,7 @@ code {
@extend .pgIndex__progress__box;
border-radius: 0 2px 2px 0;
margin-left: -1px;
border-color: var(--blue_light);
border-color: var(--main-blue--light);
cursor: pointer;

[class~="rtl"] & {
Expand All @@ -528,14 +513,14 @@ code {
.octicon__trash {
width: 18px;
height: 18px;
background-color: var(--blue_light);
background-color: var(--main-blue--light);
vertical-align: middle;
}

&:hover {
border-color: var(--blue);
border-color: var(--main-blue);
.octicon__trash {
background-color: var(--blue);
background-color: var(--main-blue);
}
}
}
Expand All @@ -544,7 +529,7 @@ code {
&__dot {
width: 10px;
height: 10px;
background-color: var(--blue);
background-color: var(--main-blue);

&.complete {
// Replace with octicon__dotFill
Expand All @@ -565,11 +550,11 @@ code {
margin: 9px 0;
font-size: .8em;
border-radius: 2px;
color: white;
color: var(--main-blue__text);

&--primary {
@extend .pgIndex__section__btn;
background: var(--blue);
background: var(--main-blue);

&:hover {
background: var(--blue_dark);
Expand Down
55 changes: 46 additions & 9 deletions assets/css/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,60 @@
*/

:root {
--blue: #0087ff;
--blue-hover: #4babff;
--blue_light: #88ccff;
--blue_light-hover: #66bdff;
--blue_lighter: #badfff;
--blue_lightest: #eaf6ff;
// --blue_lightest: #eaf6ff;
--blue_dark: #007ae6;
--blue_grey: #4f6375;
// --blue_grey: #4f6375;


--grey_darker: #5a5a5a;
//--grey_dark: #808080;
--grey: #999999;
--grey_light: #a6a6a6;
// --grey_light: #a6a6a6;

--white_darkest: #e0e0e0;
--white_darker: #f0f0f0;
--white_dark: #fafafa;
--white: #ffffff;
// --white_darkest: #e0e0e0;
// --white_darker: #f0f0f0;
// --white_dark: #fafafa;
--white-hover: #cce7ff;




--app-background: #ffffff;
--header: #fafafa;
--background-separator: #e0e0e0;
--text: #5a5a5a;
--scrollbar: #e8e8e8;

--main-blue: #0087ff;
--main-blue--light: #88ccff;
--main-blue__text: #ffffff;

--solidbox-background: #eaf6ff;
--solidbox-codebox-background: #c7e7ff;
--solidbox-text: #4f6375;
--codebox-shell-sign: #8f9aa2;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
:root {
--app-background: #1b1b1b;
--header: #191919;
--background-separator: #282c36;
--text: #c0c0c0;
--scrollbar: #323232;

--main-blue: #0064bd;
--main-blue--light: #003564;
--main-blue__text: #cfcfcf;

--solidbox-background: #282c36;
--solidbox-codebox-background: #50586c;
--solidbox-text: var(--text);
--codebox-shell-sign: #8f9aa2;

}
}
14 changes: 14 additions & 0 deletions menus/darwin-menu.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { nativeTheme } = require('electron')
const path = require('path')

module.exports = function (mainWindow, i18n) {
Expand Down Expand Up @@ -55,6 +56,19 @@ module.exports = function (mainWindow, i18n) {
label: i18n.t('menu~Minimize'),
role: 'minimize'
},
{
label: i18n.t('menu~Use &Dark Theme'),
type: 'checkbox',
accelerator: 'Ctrl+D',
checked: nativeTheme.shouldUseDarkColors,
click: event => {
if (event.checked) {
nativeTheme.themeSource = 'dark'
} else {
nativeTheme.themeSource = 'light'
}
}
},
{
type: 'separator'
},
Expand Down
Loading
Loading