Skip to content

Commit 395b969

Browse files
author
reco_luan
committed
feat: add dark mode(part.5)
1 parent 90e9fb3 commit 395b969

File tree

15 files changed

+77
-62
lines changed

15 files changed

+77
-62
lines changed

components/AlgoliaSearchBox.vue

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
class="algolia-search-wrapper search-box"
55
role="search"
66
>
7+
<i class="iconfont reco-search"></i>
78
<input
89
id="algolia-search-input"
910
class="search-query"
@@ -77,7 +78,7 @@ export default {
7778
.algolia-autocomplete
7879
line-height normal
7980
.ds-dropdown-menu
80-
background-color #fff
81+
background-color var(--background-color)
8182
border-radius $borderRadius
8283
font-size 15px
8384
margin 6px 0 0
@@ -87,16 +88,17 @@ export default {
8788
&:before
8889
display none
8990
[class*=ds-dataset-]
91+
background-color var(--background-color)
9092
border none
9193
padding 0
9294
.ds-suggestions
9395
margin-top 0
9496
.ds-suggestion
95-
border-bottom 1px solid $borderColor
97+
border-bottom 1px solid var(--border-color)
9698
.algolia-docsearch-suggestion--highlight
97-
color #2c815b
99+
color $accentColor
98100
.algolia-docsearch-suggestion
99-
border-color $borderColor
101+
border-color var(--border-color)
100102
padding 0
101103
.algolia-docsearch-suggestion--category-header
102104
padding 5px 10px
@@ -107,22 +109,24 @@ export default {
107109
.algolia-docsearch-suggestion--highlight
108110
background rgba(255, 255, 255, 0.6)
109111
.algolia-docsearch-suggestion--wrapper
112+
background var(--background-color)
110113
padding 0
111114
.algolia-docsearch-suggestion--title
112115
font-weight 600
113116
margin-bottom 0
114-
color $textColor
117+
color var(--text-color)
115118
.algolia-docsearch-suggestion--subcategory-column
116119
vertical-align top
117120
padding 5px 7px 5px 5px
118-
border-color $borderColor
119-
background #f1f3f5
121+
border-color var(--border-color)
122+
background var(--background-color)
120123
&:after
121124
display none
122125
.algolia-docsearch-suggestion--subcategory-column-text
123-
color #555
126+
color var(--text-color)
124127
.algolia-docsearch-footer
125-
border-color $borderColor
128+
border-color var(--border-color)
129+
background var(--background-color)
126130
.ds-cursor .algolia-docsearch-suggestion--content
127131
background-color #e7edf3 !important
128132
color $textColor
@@ -153,7 +157,7 @@ export default {
153157
padding 5px 7px 5px 5px !important
154158
.algolia-docsearch-suggestion--subcategory-column
155159
padding 0 !important
156-
background white !important
160+
background var(--border-color) !important
157161
.algolia-docsearch-suggestion--subcategory-column-text:after
158162
content " > "
159163
font-size 10px

components/Common.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ export default {
255255
left 0
256256
right 0
257257
margin auto
258-
background #fff
259258
.password-wrapper-out
260259
position absolute
261260
z-index 21
@@ -264,7 +263,6 @@ export default {
264263
left 0
265264
right 0
266265
margin auto
267-
background #fff
268266
.password-wrapper-in
269267
position absolute
270268
z-index 8
@@ -273,7 +271,6 @@ export default {
273271
left 0
274272
right 0
275273
margin auto
276-
background #fff
277274
.hide
278275
height 100vh
279276
overflow hidden

components/DropdownLink.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export default {
9898
line-height 1.7rem
9999
h4
100100
margin 0.45rem 0 0
101-
border-top 1px solid #eee
101+
border-top 1px solid var(--border-color)
102102
padding 0.45rem 1.5rem 0 1.25rem
103103
.dropdown-subitem-wrapper
104104
padding 0

components/Mode/modeOptions.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ const modeOptions = {
55
'--box-shadow-hover': '0 2px 16px 0 rgba(0, 0, 0, 0.2)',
66
'--text-color': '#2c3e50',
77
'--border-color': '#eaecef',
8-
'--bgm-bg-color': 'rgba(255, 255, 255, .7)'
8+
'--bgm-bg-color': 'rgba(255, 255, 255, .7)',
9+
'--code-color': 'rgba(27, 31, 35, 0.05)'
910
},
1011
dark: {
1112
'--background-color': '#25272a',
1213
'--box-shadow': '0 1px 6px 0 rgba(0, 0, 0, .9)',
1314
'--box-shadow-hover': '0 2px 26px 0 rgba(0, 0, 0, .9)',
1415
'--text-color': '#aaa',
1516
'--border-color': 'rgba(0, 0, 0, .3)',
16-
'--bgm-bg-color': 'rgba(0, 0, 0, .7)'
17+
'--bgm-bg-color': 'rgba(0, 0, 0, .7)',
18+
'--code-color': 'rgba(0, 0, 0, .3)'
1719
}
1820
}
1921

components/Navbar.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
} : {}">
2424

2525
<Mode />
26-
<Screenfull class="screenfull" />
2726
<AlgoliaSearchBox
2827
v-if="isAlgoliaSearch"
2928
:options="algolia"/>
@@ -117,9 +116,6 @@ $navbar-horizontal-padding = 1.5rem
117116
.search-box
118117
flex: 0 0 auto
119118
vertical-align top
120-
.screenfull
121-
margin-top .4rem
122-
height 1.6rem
123119
margin-right 1rem
124120
125121
@media (max-width: $MQMobile)

components/Page.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ function flatten (items, res) {
260260
.inner
261261
min-height 2rem
262262
margin-top 0
263-
border-top 1px solid $borderColor
263+
border-top 1px solid var(--border-color)
264264
padding-top 1rem
265265
overflow auto // clear float
266266
.next

components/Password.vue

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="password-shadow" :class="{'is-home': !isPage}">
3-
<h3 class="title">{{isPage ? $frontmatter.title : $site.title}}</h3>
4-
<p class="description" v-if="!isPage">{{$site.description}}</p>
3+
<h3 class="title">{{isPage ? $frontmatter.title : $site.title || $localeConfig.title}}</h3>
4+
<p class="description" v-if="!isPage">{{$site.description || $localeConfig.description}}</p>
55
<label class="inputBox" id="box">
66
<input
77
v-model="key"
@@ -109,51 +109,47 @@ export default {
109109
}
110110
111111
.password-shadow {
112+
position relative
112113
width 100vw;
113114
height 100vh;
115+
overflow hidden
114116
position relative
115117
padding-left: 20rem;
116-
// background-image: radial-gradient(ellipse farthest-corner at center top,#497EC6 0,#000105 100%);
118+
background #fff
119+
background var(--background-color)
120+
box-sizing border-box
117121
.title {
118-
position: absolute;
119-
left 0
120-
right 0
121-
top 12%
122-
margin auto
122+
margin 8rem auto 6rem
123+
width 100%
123124
text-align center
124-
color $textColor
125125
font-size 30px
126126
box-sizing: border-box;
127-
padding: 0 10px;
127+
// padding: 0 10px;
128128
text-shadow $textShadow
129+
color $textColor
130+
color var(--text-color)
129131
}
130132
.description {
131-
position: absolute;
132-
left 0
133-
right 0
134-
top 20%
135133
margin auto
136134
text-align center
137135
color $textColor
136+
color var(--text-color)
138137
font-size 22px
139138
box-sizing: border-box;
140139
padding: 0 10px;
141140
text-shadow $textShadow
142141
}
143142
.inputBox{
143+
position relative
144+
display block
144145
max-width:700px;
145146
height: 100px;
146147
background: $accentColor;
147148
border-radius: $borderRadius
148-
position: absolute;
149-
left 0
150-
right 0
151-
top 36%
152-
margin auto
149+
margin 2rem auto 0
153150
padding-left 20px
154151
box-sizing border-box
155152
opacity 0.9
156-
overflow hidden
157153
input{
158154
width:600px;
159155
height:100%;
@@ -202,11 +198,11 @@ export default {
202198
border-radius: $borderRadius
203199
position: absolute;
204200
border 1px solid $accentColor
201+
background var(--background-color)
205202
right:1px;
206203
top 1px
207204
border:0;
208205
padding:0;
209-
background: #fff;
210206
color: $accentColor;
211207
font-size:18px;
212208
outline:none;
@@ -221,7 +217,6 @@ export default {
221217
left 0
222218
right 0
223219
bottom 10%
224-
margin auto
225220
padding: 2.5rem;
226221
text-align: center;
227222
color: lighten($textColor, 25%);
@@ -242,8 +237,8 @@ export default {
242237
left 0
243238
right 0
244239
top 43%
245-
margin auto
246-
padding-left 16.4rem
240+
margin auto 20px
241+
padding-left 0
247242
box-sizing border-box
248243
opacity 0.9
249244
input{
@@ -307,11 +302,18 @@ export default {
307302
z-index: 1;
308303
}
309304
}
305+
.footer {
306+
margin-left 0
307+
308+
}
310309
}
311310
@media (max-width: $MQNarrow) {
312-
.inputBox{
313-
padding-left $mobileSidebarWidth
314-
}
311+
// .inputBox{
312+
// padding-left $mobileSidebarWidth
313+
// }
314+
.footer {
315+
margin-left 0
316+
}
315317
}
316318
}
317319

components/SearchBox.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export default {
174174
height: 2rem
175175
color lighten($textColor, 25%)
176176
display inline-block
177-
border 1px solid $accentColor
177+
border 1px solid var(--border-color)
178178
border-radius $borderRadius
179179
font-size 0.9rem
180180
line-height 2rem

index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ module.exports = (options, ctx) => ({
2323
'@vuepress-reco/extract-code',
2424
'@vuepress-reco/loading-page',
2525
'@vuepress-reco/pagation',
26-
'@vuepress-reco/screenfull',
2726
'@vuepress-reco/comments',
2827
'@vuepress/active-header-links',
2928
['@vuepress/medium-zoom', {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vuepress-theme-reco",
3-
"version": "1.1.2",
3+
"version": "1.2.0-alpha.2",
44
"description": "A simple and beautiful vuepress Blog & Doc theme.",
55
"main": "index.js",
66
"scripts": {
@@ -29,7 +29,7 @@
2929
"dependencies": {
3030
"@vuepress-reco/vuepress-plugin-back-to-top": "^1.0.5",
3131
"@vuepress-reco/vuepress-plugin-extract-code": "^1.0.3",
32-
"@vuepress-reco/vuepress-plugin-loading-page": "^1.0.0",
32+
"@vuepress-reco/vuepress-plugin-loading-page": "^1.0.2",
3333
"@vuepress-reco/vuepress-plugin-pagation": "^1.0.4",
3434
"@vuepress-reco/vuepress-plugin-screenfull": "^1.0.1",
3535
"@vuepress-reco/vuepress-plugin-ga": "^1.0.2",

0 commit comments

Comments
 (0)