Skip to content

Commit c1a8abb

Browse files
committed
Code style merge and resume some colors.
1 parent f9af2f2 commit c1a8abb

2 files changed

Lines changed: 33 additions & 28 deletions

File tree

assets/css/_dark/dark-main.scss

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* MIT Licensed
77
*/
88

9-
@mixin darkScheme() {
9+
@mixin dark-scheme {
1010
/* framework */
1111
--main-wrapper-bg: rgb(27, 27, 30);
1212
--topbar-wrapper-bg: rgb(39, 40, 43);
@@ -24,8 +24,8 @@
2424
/* common color */
2525
--text-color: rgb(175, 176, 177);
2626
--text-muted-color: rgb(107, 116, 124);
27-
--link-color: #3db5c2;
28-
--link-underline-color: #3db5c2;
27+
--link-color: rgb(138, 180, 248);
28+
--link-underline-color: rgb(99, 131, 182);
2929
--main-border: rgb(63, 65, 68);
3030
--button-bg: rgb(39, 40, 33);
3131
--blockquote-border: rgb(66, 66, 66);
@@ -57,59 +57,65 @@
5757
--timeline-node-bg: rgb(150, 152, 156);
5858
}
5959

60-
6160
/* Light scheme prefered (= dark scheme not prefered)
62-
* -> dark scheme triggered with <body class="color-scheme-dark">
61+
* -> dark scheme triggered with <html class="dark-mode">
6362
*/
64-
body.color-scheme-dark{
63+
html.dark-mode {
6564
/* Dark scheme */
66-
@include darkScheme();
65+
@include dark-scheme;
66+
6767
// Hide element in dark color scheme
6868
// (visible in light scheme)
69-
.color-scheme-dark-hidden {
69+
.dark-mode-hidden {
7070
display: none;
7171
}
72-
.color-scheme-light-hidden {
72+
73+
.light-mode-hidden {
7374
display: initial;
7475
}
7576
}
76-
body:not(.color-scheme-dark) {
77-
/* Light scheme */
77+
78+
html:not(.dark-mode) {
7879
// Hide element in dark color scheme
7980
// (visible in light scheme)
80-
.color-scheme-light-hidden {
81+
.light-mode-hidden {
8182
display: none;
8283
}
83-
.color-scheme-dark-hidden {
84+
85+
.dark-mode-hidden {
8486
display: initial;
8587
}
8688
}
8789

90+
8891
@media (prefers-color-scheme: dark) {
8992
/* Dark scheme prefered
90-
* -> light scheme triggered with <body class="color-scheme-light">
93+
* -> light scheme triggered with <html class="light-mode">
9194
*/
92-
body:not(.color-scheme-light) {
95+
html:not(.light-mode) {
9396
/* Dark scheme */
94-
@include darkScheme();
97+
@include dark-scheme;
9598
// Hide element in dark color scheme
9699
// (visible in light scheme)
97-
.color-scheme-dark-hidden {
100+
.dark-mode-hidden {
98101
display: none;
99102
}
100-
.color-scheme-light-hidden {
103+
104+
.light-mode-hidden {
101105
display: initial;
102106
}
103107
}
104-
body.color-scheme-light {
108+
109+
html.light-mode {
105110
/* Light scheme */
106111
// Hide element in dark color scheme
107112
// (visible in light scheme)
108-
.color-scheme-light-hidden {
113+
.light-mode-hidden {
109114
display: none;
110115
}
111-
.color-scheme-dark-hidden {
116+
.dark-mode-hidden {
112117
display: initial;
113118
}
114119
}
120+
115121
}

assets/css/_dark/dark-syntax.scss

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
* MIT Licensed
77
*/
88

9-
@mixin darkSchemeHighlight() {
10-
9+
@mixin dark-sheme {
1110
/* syntax highlight colors from https://raw.githubusercontent.com/jwarby/pygments-css/master/monokai.css */
1211
--highlight-pre-bg: #272822;
1312
--highlight-hll-bg: #272822;
@@ -87,13 +86,13 @@
8786
}
8887

8988
@media (prefers-color-scheme: dark) {
90-
body:not(.color-scheme-light) {
91-
@include darkSchemeHighlight();
89+
html:not(.light-mode) {
90+
@include dark-sheme;
9291
}
9392
}
9493

95-
@media not (prefers-color-scheme: dark) {
96-
body.color-scheme-dark {
97-
@include darkSchemeHighlight();
94+
@media (prefers-color-scheme: light) {
95+
html.dark-mode {
96+
@include dark-sheme;
9897
}
9998
}

0 commit comments

Comments
 (0)