Skip to content

Commit 45e62b7

Browse files
committed
ui: make dark mode beautifier
1 parent ed712a2 commit 45e62b7

File tree

4 files changed

+59
-57
lines changed

4 files changed

+59
-57
lines changed

src/scss/blog_basic.scss

+54-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
:root {
2+
--mono-font-face: 'mononoki', 'Consolas', 'Roboto Mono', 'Lucida Console', 'Trebuchet MS', 'Courier New', 'courier',
3+
monospace;
4+
}
5+
16
.content > .post > .post-content > p {
27
word-wrap: break-word;
38
word-break: break-all;
@@ -10,6 +15,7 @@
1015
}
1116

1217
html {
18+
-webkit-font-smoothing: antialiased;
1319
height: 100%;
1420
max-height: 100%;
1521
padding: 0;
@@ -20,6 +26,16 @@ body {
2026
padding: 0;
2127
margin: 0;
2228
line-height: 1.6em;
29+
color: var(--primary-high);
30+
font-family: 'Open Sans', Helvetica, Arial, 'PingHei', 'PingFang SC', Helvetica, 'Work Sans', 'Hiragino Sans GB',
31+
'Microsoft YaHei', SimSun, sans-serif;
32+
font-size: 15px;
33+
width: 100%;
34+
margin: 0 auto 30px auto;
35+
background-color: var(--secondary);
36+
transition:
37+
background-color 0.8s,
38+
color 0.8s;
2339
}
2440

2541
.clear {
@@ -107,6 +123,32 @@ a img {
107123
border: none;
108124
}
109125

126+
p {
127+
line-height: 1.9em;
128+
font-weight: 400;
129+
font-size: 15px;
130+
}
131+
132+
a {
133+
text-decoration: none;
134+
}
135+
136+
a:link,
137+
a:visited {
138+
opacity: 1;
139+
-webkit-transition: all 0.15s linear;
140+
-moz-transition: all 0.15s linear;
141+
-o-transition: all 0.15s linear;
142+
-ms-transition: all 0.15s linear;
143+
transition: all 0.15s linear;
144+
color: var(--primary-700);
145+
}
146+
147+
a:hover,
148+
a:active {
149+
color: var(--tertiary);
150+
}
151+
110152
dl {
111153
dt {
112154
float: left;
@@ -174,16 +216,23 @@ mark {
174216
code,
175217
tt {
176218
padding: 1px 3px;
177-
font-family: Inconsolata, monospace, sans-serif;
178-
font-size: 0.95em;
219+
font-family: var(--mono-font-face);
179220
white-space: pre-wrap;
180-
border: 1px solid var(--primary-200);
181221
background-color: var(--secondary-950);
182222
transition:
183223
background-color 0.8s,
184224
border 0.8s;
185-
color: #d14;
186-
border-radius: 2px;
225+
color: var(--primary-700);
226+
border-radius: 3px;
227+
}
228+
229+
pre {
230+
font-size: 15px;
231+
background-color: var(--secondary-950) !important;
232+
font-family: var(--mono-font-face) !important;
233+
text-wrap: wrap;
234+
overflow-wrap: anywhere;
235+
color: var(--primary-700) !important;
187236
}
188237

189238
kbd {

src/scss/color-defination.scss

+4
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,19 @@
1919
@mixin darkTheme() {
2020
$primary: 255 255 255;
2121
$secondary: 40 40 40;
22+
$tertiary: 181 206 255;
2223
@include genColor('primary', $primary, $secondary);
2324
@include genColor('secondary', $secondary, $primary);
25+
@include genColor('tertiary', $tertiary, $secondary);
2426
}
2527

2628
@mixin lightTheme() {
2729
$primary: 22 22 22;
2830
$secondary: 255 255 255;
31+
$tertiary: 71 134 214;
2932
@include genColor('primary', $primary, $secondary);
3033
@include genColor('secondary', $secondary, $primary);
34+
@include genColor('tertiary', $tertiary, $secondary);
3135
}
3236

3337
html[theme='default'] {

src/scss/highlight.scss

-7
Original file line numberDiff line numberDiff line change
@@ -1231,13 +1231,6 @@ figure.highlight {
12311231
}
12321232

12331233
pre {
1234-
font-size: 15px;
1235-
background-color: var(--secondary-950) !important;
1236-
font-family: 'mononoki', 'Consolas', 'Roboto Mono', 'Lucida Console', 'Trebuchet MS', 'Courier New', 'Monaco',
1237-
'courier', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft Jhenghei', 'Microsoft YaHei', monospace !important;
1238-
1239-
color: var(--primary-700) !important;
1240-
12411234
.function .keyword,
12421235
.constant {
12431236
color: #0092db !important;

src/scss/style.scss

+1-45
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,6 @@
22

33
$site-border: 1px solid var(--primary-100);
44

5-
html {
6-
-webkit-font-smoothing: antialiased;
7-
// transition: all 0.2s ease-out;
8-
}
9-
10-
body {
11-
color: var(--primary-high);
12-
font-family: 'Open Sans', Helvetica, Arial, 'PingHei', 'PingFang SC', Helvetica, 'Work Sans', 'Hiragino Sans GB',
13-
'Microsoft YaHei', SimSun, sans-serif;
14-
font-size: 15px;
15-
width: 100%;
16-
margin: 0 auto 30px auto;
17-
background-color: var(--secondary);
18-
transition:
19-
background-color 0.8s,
20-
color 0.8s;
21-
}
22-
23-
p {
24-
line-height: 1.9em;
25-
font-weight: 400;
26-
font-size: 15px;
27-
}
28-
29-
a {
30-
text-decoration: none;
31-
}
32-
33-
a:link,
34-
a:visited {
35-
opacity: 1;
36-
-webkit-transition: all 0.15s linear;
37-
-moz-transition: all 0.15s linear;
38-
-o-transition: all 0.15s linear;
39-
-ms-transition: all 0.15s linear;
40-
transition: all 0.15s linear;
41-
color: var(--secondary-300);
42-
}
43-
44-
a:hover,
45-
a:active {
46-
color: #4786d6;
47-
}
48-
495
/* basic styles ends */
506
/* animation starts */
517
.animated {
@@ -420,7 +376,7 @@ a:active {
420376
.post-content {
421377
a {
422378
text-decoration: none;
423-
color: #4786d6;
379+
color: var(--tertiary);
424380
}
425381

426382
a:hover {

0 commit comments

Comments
 (0)