Skip to content

Commit 748e560

Browse files
author
reco_luan
committed
fix: dark mode
1 parent 1481d47 commit 748e560

File tree

9 files changed

+23
-82
lines changed

9 files changed

+23
-82
lines changed

components/DropdownLink.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export default {
161161
// make the arrow always down at desktop
162162
border-left 4px solid transparent
163163
border-right 4px solid transparent
164-
border-top 6px solid $textColorSub
164+
border-top 6px solid var(--text-color-sub)
165165
border-bottom 0
166166
.nav-dropdown
167167
display none

components/Mode/modeOptions.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ const modeOptions = {
1010
'--default-color-3': 'rgba(255, 255, 255, .3)',
1111
'--default-color-2': 'rgba(255, 255, 255, .2)',
1212
'--default-color-1': 'rgba(255, 255, 255, .1)',
13-
'--background-color': '#fff',
13+
'--background-color': '#F5F5F5',
1414
'--box-shadow': '0 1px 6px 0 rgba(0, 0, 0, 0.2)',
1515
'--box-shadow-hover': '0 2px 16px 0 rgba(0, 0, 0, 0.2)',
16-
'--text-color': '#2c3e50',
16+
'--text-color': '#242424',
17+
'--text-color-sub': '#7F7F7F',
1718
'--border-color': '#eaecef',
1819
'--code-color': 'rgba(27, 31, 35, 0.05)',
1920
'--mask-color': '#888'
@@ -29,10 +30,11 @@ const modeOptions = {
2930
'--default-color-3': 'rgba(0, 0, 0, .3)',
3031
'--default-color-2': 'rgba(0, 0, 0, .2)',
3132
'--default-color-1': 'rgba(0, 0, 0, .1)',
32-
'--background-color': '#202124',
33+
'--background-color': '#181818',
3334
'--box-shadow': '0 1px 6px 0 rgba(0, 0, 0, .9)',
3435
'--box-shadow-hover': '0 2px 26px 0 rgba(0, 0, 0, .9)',
35-
'--text-color': '#fff',
36+
'--text-color': '#E8E8E8',
37+
'--text-color-sub': '#8B8B8B',
3638
'--border-color': 'rgba(0, 0, 0, .3)',
3739
'--code-color': 'rgba(0, 0, 0, .3)',
3840
'--mask-color': '#000'

components/Mode/setMode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default function setMode () {
2929
console.log('You specified no preference for a color scheme or your browser does not support it. I schedule dark mode during night time.')
3030
const now = new Date()
3131
const hour = now.getHours()
32-
if (hour < 4 || hour >= 16) {
32+
if (hour < 6 || hour >= 18) {
3333
activateMode('dark')
3434
}
3535
}

layouts/TimeLines.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export default {
124124
.date {
125125
width 40px
126126
line-height 30px
127-
color $textColorSub
127+
color var(--text-color-sub)
128128
font-size 12px
129129
&::before {
130130
content: " ";
@@ -142,7 +142,7 @@ export default {
142142
}
143143
.title {
144144
line-height 30px
145-
color $textColorSub
145+
color var(--text-color-sub)
146146
font-size 16px
147147
cursor pointer
148148
}

styles/arrow.styl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
&.up
88
border-left 4px solid transparent
99
border-right 4px solid transparent
10-
border-bottom 6px solid $textColorSub
10+
border-bottom 6px solid var(--text-color-sub)
1111
&.down
1212
border-left 4px solid transparent
1313
border-right 4px solid transparent
14-
border-top 6px solid $textColorSub
14+
border-top 6px solid var(--text-color-sub)
1515
&.right
1616
border-top 4px solid transparent
1717
border-bottom 4px solid transparent
18-
border-left 6px solid $textColorSub
18+
border-left 6px solid var(--text-color-sub)
1919
&.left
2020
border-top 4px solid transparent
2121
border-bottom 4px solid transparent
22-
border-right 6px solid $textColorSub
22+
border-right 6px solid var(--text-color-sub)

styles/mode.styl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
--box-shadow $boxShadow
1414
--box-shadow-hover $boxShadowHover
1515
--text-color $textColor
16+
--text-color-sub $textColorSub
1617
--border-color $borderColor
1718
--code-color $codeColor
1819
--mask-color $maskColor
@@ -31,6 +32,7 @@
3132
--box-shadow $boxShadowDark
3233
--box-shadow-hover $boxShadowHoverDark
3334
--text-color $textColorDark
35+
--text-color-sub $textColorSubDark
3436
--border-color $borderColorDark
3537
--code-color $codeColorDark
3638
--mask-color $maskColorDark

styles/palette.styl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,19 @@ $lightColor1 = rgba(255, 255, 255, .1)
2323
$textShadow = 0 2px 4px $darkColor1;
2424
$borderRadius = .25rem
2525
$lineNumbersWrapperWidth = 2.5rem
26-
$textColorSub = #888
2726

28-
$backgroundColor ?= #fff
29-
$backgroundColorDark ?= #202124
27+
$backgroundColor ?= #F5F5F5
28+
$backgroundColorDark ?= #181818
3029

3130
$boxShadow = 0 1px 6px 0 $darkColor2
3231
$boxShadowHover = 0 2px 16px 0 $darkColor2
3332
$boxShadowDark = 0 1px 6px 0 $darkColor6
3433
$boxShadowHoverDark = 0 2px 16px 0 $darkColor6
3534

36-
$textColor ?= #2c3e50
37-
$textColorDark ?= #fff
35+
$textColor ?= #242424
36+
$textColorDark ?= #E8E8E8
37+
$textColorSub = #7F7F7F
38+
$textColorSubDark = #8B8B8B
3839

3940
$borderColor ?= #eaecef
4041
$borderColorDark ?= $darkColor3

styles/palette2.styl

Lines changed: 0 additions & 64 deletions
This file was deleted.

styles/theme.styl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ th, td
188188

189189
.iconfont
190190
font-size: 0.9rem;
191-
color: $textColorSub;
191+
color: var(--text-color-sub);
192192

193193
/************** 滚动条 **************/
194194
::-webkit-scrollbar

0 commit comments

Comments
 (0)