Skip to content

Commit fa6df6d

Browse files
fix: Legacy bugs (styles, site plugin error, and dev server error) (#1743)
* Add try/catch w/ error message to plugin calls * Update lifecycle.js * Update lifecycle.js * Fix docsify-plugin-carbon error * Fix ESLint errors * Simplify conditional JS loading * Fix styles in legacy browser w/o CSS var support * Fix gitignore paths * Fix BrowserSync IE error * Fix search field presentation in IE11 - Removed fixed height and allow element to size naturally via font-size and padding - Remove default "x" rendered on IE input fields * Revert "Update lifecycle.js" This reverts commit 2a58be6. * Revert "Update lifecycle.js" This reverts commit 67c5410. * Revert "Add try/catch w/ error message to plugin calls" This reverts commit 631e924. * Fix docsify-plugin-carbon error & ESLint errors Co-authored-by: 沈唁 <[email protected]>
1 parent 8aee074 commit fa6df6d

File tree

10 files changed

+75
-35
lines changed

10 files changed

+75
-35
lines changed

docs/index.html

+19-23
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
<body>
5757
<div id="app">Loading ...</div>
58-
<script src="//cdn.jsdelivr.net/npm/docsify-plugin-carbon@1/index.js"></script>
58+
<script src="//cdn.jsdelivr.net/npm/docsify-plugin-carbon@1"></script>
5959
<script>
6060
// Set html "lang" attribute based on URL
6161
var lang = location.hash.match(/#\/(de-de|es|ru-ru|zh-cn)\//);
@@ -118,21 +118,21 @@
118118
'/zh-cn/': '搜索',
119119
'/': 'Search',
120120
},
121-
pathNamespaces: ['/es', '/de-de', '/ru-ru', '/zh-cn']
121+
pathNamespaces: ['/es', '/de-de', '/ru-ru', '/zh-cn'],
122122
},
123123
vueComponents: {
124124
'button-counter': {
125125
template:
126126
'<button @click="count += 1">You clicked me {{ count }} times</button>',
127-
data: function() {
127+
data: function () {
128128
return {
129129
count: 0,
130130
};
131131
},
132132
},
133133
},
134134
vueGlobalOptions: {
135-
data: function() {
135+
data: function () {
136136
return {
137137
count: 0,
138138
message: 'Hello, World!',
@@ -145,7 +145,7 @@
145145
};
146146
},
147147
computed: {
148-
timeOfDay: function() {
148+
timeOfDay: function () {
149149
const date = new Date();
150150
const hours = date.getHours();
151151

@@ -159,14 +159,14 @@
159159
},
160160
},
161161
methods: {
162-
hello: function() {
162+
hello: function () {
163163
alert(this.message);
164164
},
165165
},
166166
},
167167
vueMounts: {
168168
'#counter': {
169-
data: function() {
169+
data: function () {
170170
return {
171171
count: 0,
172172
};
@@ -175,8 +175,8 @@
175175
},
176176
plugins: [
177177
DocsifyCarbon.create('CEBI6KQE', 'docsifyjsorg'),
178-
function(hook, vm) {
179-
hook.beforeEach(function(html) {
178+
function (hook, vm) {
179+
hook.beforeEach(function (html) {
180180
if (/githubusercontent\.com/.test(vm.route.file)) {
181181
url = vm.route.file
182182
.replace('raw.githubusercontent.com', 'github.com')
@@ -198,7 +198,7 @@
198198
'<a href="https://docsify.js.org" target="_blank" style="color: inherit; font-weight: normal; text-decoration: none;">Powered by docsify</a>'
199199
);
200200
}),
201-
hook.afterEach(function(html) {
201+
hook.afterEach(function (html) {
202202
if (vm.route.path === '/') {
203203
return html;
204204
}
@@ -218,19 +218,15 @@
218218
<script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-nginx.min.js"></script>
219219
<script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-php.min.js"></script>
220220
<script>
221-
(function() {
222-
function loadJS(src, attrs) {
223-
document.write(
224-
'<script src="' + src + '" ' + (attrs || '') + '><\/script>'
225-
);
226-
}
227-
228-
// Public site only
229-
if (/docsify/.test(location.host)) {
230-
loadJS('//cdn.jsdelivr.net/npm/docsify@4/lib/plugins/ga.min.js');
231-
loadJS('//cdn.jsdelivr.net/npm/docsify@4/lib/plugins/matomo.min.js');
232-
}
233-
})();
221+
// Public site only
222+
if (/docsify/.test(location.host)) {
223+
document.write(
224+
'<script src="//cdn.jsdelivr.net/npm/docsify@4/lib/plugins/ga.min.js"><\/script>'
225+
);
226+
document.write(
227+
'<script src="//cdn.jsdelivr.net/npm/docsify@4/lib/plugins/matomo.min.js"><\/script>'
228+
);
229+
}
234230
</script>
235231
<script src="//cdn.jsdelivr.net/npm/vue@2/dist/vue.min.js"></script>
236232
<!-- <script src="//cdn.jsdelivr.net/npm/vue@3/dist/vue.global.prod.js"></script> -->

index.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
<body>
2525
<div id="app"></div>
26-
<script src="//cdn.jsdelivr.net/npm/docsify-plugin-carbon@1/index.min.js"></script>
26+
<script src="//cdn.jsdelivr.net/npm/docsify-plugin-carbon@1"></script>
2727
<script>
2828
// Set html "lang" attribute based on URL
2929
var lang = location.hash.match(/#\/(de-de|es|ru-ru|zh-cn)\//);
@@ -82,12 +82,12 @@
8282
'/zh-cn/': '搜索',
8383
'/': 'Search',
8484
},
85-
pathNamespaces: ['/es', '/de-de', '/ru-ru', '/zh-cn']
85+
pathNamespaces: ['/es', '/de-de', '/ru-ru', '/zh-cn'],
8686
},
8787
plugins: [
8888
DocsifyCarbon.create('CEBI6KQE', 'docsifyjsorg'),
89-
function(hook, vm) {
90-
hook.beforeEach(function(html) {
89+
function (hook, vm) {
90+
hook.beforeEach(function (html) {
9191
if (/githubusercontent\.com/.test(vm.route.file)) {
9292
url = vm.route.file
9393
.replace('raw.githubusercontent.com', 'github.com')

src/plugins/search/component.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ function style() {
3333
outline: none;
3434
border: none;
3535
width: 100%;
36-
padding: 0 7px;
37-
line-height: 36px;
38-
font-size: 14px;
36+
padding: 0.6em 7px;
37+
font-size: inherit;
3938
border: 1px solid transparent;
4039
}
4140
@@ -51,6 +50,13 @@ function style() {
5150
-moz-appearance: none;
5251
appearance: none;
5352
}
53+
54+
.search input::-ms-clear {
55+
display: none;
56+
height: 0;
57+
width: 0;
58+
}
59+
5460
.search .clear-button {
5561
cursor: pointer;
5662
width: 36px;

src/themes/basic/_coverpage.styl

+5
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,13 @@ section.cover
6464
padding 0
6565

6666
.cover-main > p:last-child a
67+
border-color $color-primary
6768
border-color var(--theme-color, $color-primary)
6869
border-radius 2rem
6970
border-style solid
7071
border-width 1px
7172
box-sizing border-box
73+
color $color-primary
7274
color var(--theme-color, $color-primary)
7375
display inline-block
7476
font-size 1.05rem
@@ -79,6 +81,7 @@ section.cover
7981
transition all 0.15s ease
8082

8183
&:last-child
84+
background-color $color-primary
8285
background-color var(--theme-color, $color-primary)
8386
color #fff
8487

@@ -90,8 +93,10 @@ section.cover
9093
color inherit
9194

9295
blockquote > p > a
96+
border-bottom 2px solid $color-primary
9397
border-bottom 2px solid var(--theme-color, $color-primary)
9498
transition color 0.3s
9599

96100
&:hover
101+
color $color-primary
97102
color var(--theme-color, $color-primary)

src/themes/basic/_layout.styl

+8
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ div#app
2626
vertical-align middle
2727

2828
.progress
29+
background-color $color-primary
2930
background-color var(--theme-color, $color-primary)
3031
height 2px
3132
left 0px
@@ -37,9 +38,11 @@ div#app
3738
z-index 999999
3839

3940
.search a:hover
41+
color $color-primary
4042
color var(--theme-color, $color-primary)
4143

4244
.search .search-keyword
45+
color $color-primary
4346
color var(--theme-color, $color-primary)
4447
font-style normal
4548
font-weight bold
@@ -108,10 +111,13 @@ li input[type='checkbox']
108111
transition color 0.3s
109112

110113
&:hover
114+
color $color-primary
111115
color var(--theme-color, $color-primary)
112116

113117
&.active
118+
border-bottom 2px solid $color-primary
114119
border-bottom 2px solid var(--theme-color, $color-primary)
120+
color $color-primary
115121
color var(--theme-color, $color-primary)
116122

117123
/* navbar dropdown */
@@ -172,6 +178,7 @@ li input[type='checkbox']
172178

173179
svg
174180
color $color-bg
181+
fill $color-primary
175182
fill var(--theme-color, $color-primary)
176183
height 80px
177184
width 80px
@@ -284,6 +291,7 @@ main.hidden
284291
opacity 0.4
285292

286293
span
294+
background-color $color-primary
287295
background-color var(--theme-color, $color-primary)
288296
display block
289297
margin-bottom 4px

src/themes/buble.styl

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ $sidebar-width = 16rem
4040
font-weight 600
4141

4242
.markdown-section a
43+
color $color-primary
4344
color var(--theme-color, $color-primary)
4445

4546
.markdown-section p, .markdown-section ul, .markdown-section ol
@@ -83,6 +84,7 @@ $sidebar-width = 16rem
8384
margin 0
8485

8586
.markdown-section blockquote
87+
border-left 4px solid $color-primary
8688
border-left 4px solid var(--theme-color, $color-primary)
8789
color #858585
8890
margin 2em 0

src/themes/dark.styl

+5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ body
3434
padding 0
3535

3636
ul li.active > a
37+
color $color-primary
3738
color var(--theme-color, $color-primary)
3839
font-weight 600
3940

@@ -43,6 +44,7 @@ body
4344
font-weight 600
4445

4546
.markdown-section a
47+
color $color-primary
4648
color var(--theme-color, $color-primary)
4749
font-weight 600
4850

@@ -79,6 +81,7 @@ body
7981
padding-left 1.5rem
8082

8183
.markdown-section blockquote
84+
border-left 4px solid $color-primary
8285
border-left 4px solid var(--theme-color, $color-primary)
8386
color #858585
8487
margin 2em 0
@@ -138,6 +141,7 @@ body
138141
color #2973b7
139142

140143
.token.string
144+
color $color-primary
141145
color var(--theme-color, $color-primary)
142146

143147
.token.selector
@@ -150,6 +154,7 @@ body
150154
color #22a2c9
151155

152156
.token.attr-value, .token.control, .token.directive, .token.unit
157+
color $color-primary
153158
color var(--theme-color, $color-primary)
154159

155160
.token.keyword

src/themes/dolphin.styl

+6-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ body
3636

3737
ul li.active > a
3838
border-right 2px solid
39+
color $color-primary
3940
color var(--theme-color, $color-primary)
4041
font-weight 600
4142

@@ -52,9 +53,10 @@ body
5253
font-weight 600
5354

5455
.markdown-section a
56+
color $color-primary
5557
color var(--theme-color, $color-primary)
5658
font-weight 600
57-
59+
5860
&:hover
5961
text-decoration underline
6062

@@ -91,6 +93,7 @@ body
9193
padding-left 1.5rem
9294

9395
.markdown-section blockquote
96+
border-left 4px solid $color-primary
9497
border-left 4px solid var(--theme-color, $color-primary)
9598
color #858585
9699
margin 2em 0
@@ -150,6 +153,7 @@ body
150153
color #2973b7
151154

152155
.token.string
156+
color $color-primary
153157
color var(--theme-color, $color-primary)
154158

155159
.token.selector
@@ -162,6 +166,7 @@ body
162166
color #22a2c9
163167

164168
.token.attr-value, .token.control, .token.directive, .token.unit
169+
color $color-primary
165170
color var(--theme-color, $color-primary)
166171

167172
.token.keyword, .token.function

src/themes/vue.styl

+5
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ body
3636

3737
ul li.active > a
3838
border-right 2px solid
39+
color $color-primary
3940
color var(--theme-color, $color-primary)
4041
font-weight 600
4142

@@ -52,6 +53,7 @@ body
5253
font-weight 600
5354

5455
.markdown-section a
56+
color $color-primary
5557
color var(--theme-color, $color-primary)
5658
font-weight 600
5759

@@ -88,6 +90,7 @@ body
8890
padding-left 1.5rem
8991

9092
.markdown-section blockquote
93+
border-left 4px solid $color-primary
9194
border-left 4px solid var(--theme-color, $color-primary)
9295
color #858585
9396
margin 2em 0
@@ -204,6 +207,7 @@ body
204207
color #2973b7
205208

206209
.token.string
210+
color $color-primary
207211
color var(--theme-color, $color-primary)
208212

209213
.token.selector
@@ -216,6 +220,7 @@ body
216220
color #22a2c9
217221

218222
.token.attr-value, .token.control, .token.directive, .token.unit
223+
color $color-primary
219224
color var(--theme-color, $color-primary)
220225

221226
.token.keyword, .token.function

0 commit comments

Comments
 (0)