Skip to content

Commit 90e9fb3

Browse files
author
reco_luan
committed
feat: add dark mode(part.4)
1 parent 51a155e commit 90e9fb3

File tree

6 files changed

+13
-123
lines changed

6 files changed

+13
-123
lines changed

components/Mode/modeOptions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const modeOptions = {
1212
'--box-shadow': '0 1px 6px 0 rgba(0, 0, 0, .9)',
1313
'--box-shadow-hover': '0 2px 26px 0 rgba(0, 0, 0, .9)',
1414
'--text-color': '#aaa',
15-
'--border-color': 'rgba(0, 0, 0, .9)',
15+
'--border-color': 'rgba(0, 0, 0, .3)',
1616
'--bgm-bg-color': 'rgba(0, 0, 0, .7)'
1717
}
1818
}

components/SearchBox.vue

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ export default {
165165
position absolute
166166
top 0
167167
bottom 0
168+
z-index 0
168169
left .6rem
169170
margin auto
170171
input
@@ -173,20 +174,20 @@ export default {
173174
height: 2rem
174175
color lighten($textColor, 25%)
175176
display inline-block
176-
border 1px solid darken($borderColor, 10%)
177-
border-radius 2rem
177+
border 1px solid $accentColor
178+
border-radius $borderRadius
178179
font-size 0.9rem
179180
line-height 2rem
180181
padding 0 0.5rem 0 2rem
181182
outline none
182183
transition all .2s ease
183-
background #fff
184+
background transparent
184185
background-size 1rem
185186
&:focus
186187
cursor auto
187188
border-color $accentColor
188189
.suggestions
189-
background #fff
190+
background var(--background-color)
190191
width 20rem
191192
position absolute
192193
top 1.5rem
@@ -203,14 +204,14 @@ export default {
203204
cursor pointer
204205
a
205206
white-space normal
206-
color lighten($textColor, 35%)
207+
color var(--text-color)
207208
.page-title
208209
font-weight 600
209210
.header
210211
font-size 0.9em
211212
margin-left 0.25em
212213
&.focused
213-
background-color #f3f4f5
214+
background-color var(--border-color)
214215
a
215216
color $accentColor
216217
@media (max-width: $MQNarrow)
@@ -235,8 +236,6 @@ export default {
235236
@media (max-width: $MQMobile)
236237
.search-box
237238
margin-right 0
238-
input
239-
left 1rem
240239
.suggestions
241240
right 0
242241
@media (max-width: $MQMobileNarrow)

layouts/Category.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
:key="index">
1212
<router-link :to="item.path">
1313
<span class="category-name">{{ item.name }}</span>
14-
<span class="post-num">{{ item.pages.length }}</span>
14+
<span class="post-num" :style="{ 'backgroundColor': _tagColor() }">{{ item.pages.length }}</span>
1515
</router-link>
1616
</li>
1717
</ul>
@@ -146,8 +146,8 @@ export default {
146146
text-align center
147147
line-height 1.2rem
148148
border-radius $borderRadius
149-
background #eee
150149
font-size .7rem
150+
color #fff
151151
}
152152
}
153153
}

styles/colorMixin.styl

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

styles/palette.styl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ $backgroundColorDark ?= #25272a
77

88
$boxShadow = 0 1px 6px 0 rgba(0, 0, 0, 0.2)
99
$boxShadowHover = 0 2px 16px 0 rgba(0, 0, 0, 0.2)
10-
$boxShadowDark = 0 1px 6px 0 rgba(0, 0, 0, .9)
11-
$boxShadowHoverDark = 0 2px 26px 0 rgba(0, 0, 0, .9)
10+
$boxShadowDark = 0 1px 6px 0 rgba(0, 0, 0, .6)
11+
$boxShadowHoverDark = 0 2px 16px 0 rgba(0, 0, 0, .6)
1212

1313
$textColor ?= #2c3e50
1414
$textColorDark ?= #aaa
1515

1616
$borderColor ?= #eaecef
17-
$borderColorDark ?= rgba(0, 0, 0, .9)
17+
$borderColorDark ?= rgba(0, 0, 0, .3)
1818

1919
$bgmBgColor ?= rgba(255, 255, 255, .7)
2020
$bgmBgColorDark ?= rgba(0, 0, 0, .7)

styles/theme.styl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
@require './arrow'
55
@require './wrapper'
66
@require './toc'
7-
@require './colorMixin'
87
@require './iconfont.css'
98

109
html, body
@@ -297,13 +296,6 @@ th, td
297296
background-color: var(--background-color)!important
298297
box-shadow: var(--box-shadow)!important
299298

300-
/************** 搜索框 **************/
301-
302-
.search-box input
303-
border-radius: $borderRadius
304-
background: var(--background-color) url(/assets/img/search.svg) 0.6rem 0.6rem no-repeat
305-
border-color: var(--border-color)
306-
307299
/********* 悬浮卡片背景颜色 **********/
308300

309301
.navbar

0 commit comments

Comments
 (0)