Skip to content

Commit 0d18a7b

Browse files
committed
fix(site): add html selector before .dark
1 parent 3146ed7 commit 0d18a7b

File tree

8 files changed

+24
-20
lines changed

8 files changed

+24
-20
lines changed

examples/sites/src/assets/custom-block.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ body {
8484
--color-danger-title: #900;
8585
}
8686
}
87-
.dark {
87+
html.dark {
8888
.markdown-body {
8989
--color-tip-fg: #d3d5d6;
9090
--color-tip-bg: #24292f;

examples/sites/src/assets/custom-markdown.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
}
55

66
/* 以下为 github-markdown-css 包的预制颜色,根据暗色主题再修改 */
7-
.dark .markdown-body {
7+
html.dark .markdown-body {
88
color-scheme: dark;
99
--color-prettylights-syntax-comment: #8b949e;
1010
--color-prettylights-syntax-constant: #79c0ff;
@@ -99,22 +99,22 @@ body .markdown-body {
9999
text-shadow: none !important;
100100
}
101101

102-
.dark.dark .markdown-body {
102+
html.dark.dark .markdown-body {
103103
background-color: #000;
104104
}
105105

106-
.dark.dark .markdown-body pre {
106+
html.dark.dark .markdown-body pre {
107107
background-color: #1a1a1a;
108108
}
109109

110-
.dark.dark .markdown-body code {
110+
html.dark.dark .markdown-body code {
111111
color: var(--tv-color-text);
112112
}
113113

114-
.dark.dark .markdown-body code .token.operator {
114+
html.dark.dark .markdown-body code .token.operator {
115115
background-color: transparent;
116116
}
117117

118-
.dark.dark .markdown-body code .hljs-string {
118+
html.dark.dark .markdown-body code .hljs-string {
119119
color: #6f42c1;
120120
}

examples/sites/src/views/components-doc/components/api-docs.vue

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,7 @@ defineExpose({ jumpToApi })
184184
color: var(--primary);
185185
border: 1px solid var(--primary);
186186
}
187-
.dark .api-groupname-tag {
188-
color: var(--tv-color-text-secondary);
189-
background-color: var(--tv-color-bg-header);
190-
border: none;
191-
}
187+
192188
.api-table-box {
193189
overflow-x: auto;
194190
width: 100%;
@@ -231,3 +227,11 @@ defineExpose({ jumpToApi })
231227
}
232228
}
233229
</style>
230+
231+
<style lang="less">
232+
html.dark .api-groupname-tag {
233+
color: var(--tv-color-text-secondary);
234+
background-color: var(--tv-color-bg-header);
235+
border: none;
236+
}
237+
</style>

examples/sites/src/views/components-doc/components/demo.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,12 +398,12 @@ onBeforeUnmount(() => {
398398
</style>
399399

400400
<style lang="less">
401-
.dark .pc-demo-container.pc-demo-container {
401+
html.dark .pc-demo-container.pc-demo-container {
402402
background-color: #1a1a1a;
403403
border: none;
404404
}
405405
406-
.dark .demo-content.demo-content .demo-desc {
406+
html.dark .demo-content.demo-content .demo-desc {
407407
color: #b3b3b3;
408408
}
409409
</style>

examples/sites/src/views/components-doc/components/float-settings.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ export default defineComponent({
275275
margin-right: 0;
276276
}
277277
}
278-
.dark .settings-btn {
278+
html.dark .settings-btn {
279279
background-color: var(--tv-color-bg-dark);
280280
}
281281
@@ -363,7 +363,7 @@ export default defineComponent({
363363
border-radius: 12px;
364364
background-color: var(--tv-color-bg);
365365
}
366-
.dark .tiny-popover.tiny-popper.theme-settings-popover {
366+
html.dark .tiny-popover.tiny-popper.theme-settings-popover {
367367
background-color: var(--tv-color-bg-dark);
368368
}
369369

examples/sites/src/views/components-doc/components/header.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const mdContent = computed(() =>
7070
</style>
7171

7272
<style lang="less">
73-
.dark .docs-header {
73+
html.dark .docs-header {
7474
background-color: #1a1a1a;
7575
7676
.markdown-top-body {

examples/sites/src/views/layout/layout.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ export default defineComponent({
394394
}
395395
}
396396
397-
.dark #layoutSider {
397+
html.dark #layoutSider {
398398
border-right: 1px solid #1a1a1a; // 没有常用变量
399399
}
400400

examples/sites/src/views/overview.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export default defineComponent({
214214
}
215215
}
216216
217-
.dark .component-card {
217+
html.dark .component-card {
218218
&:hover {
219219
box-shadow: 1px 1px 6px 6px rgba(255, 255, 255, 0.08);
220220
}
@@ -229,7 +229,7 @@ export default defineComponent({
229229
width: 24.25%;
230230
}
231231
232-
.dark .overview-card-container {
232+
html.dark .overview-card-container {
233233
background-color: var(--tv-color-bg-dark);
234234
}
235235

0 commit comments

Comments
 (0)