dumi 2.0.18 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/theme-api/context.d.ts +1 -1
- package/dist/client/theme-api/index.d.ts +1 -0
- package/dist/client/theme-api/index.js +1 -0
- package/dist/client/theme-api/types.d.ts +4 -0
- package/dist/client/theme-api/usePrefersColor.d.ts +7 -0
- package/dist/client/theme-api/usePrefersColor.js +199 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +6 -0
- package/dist/features/configPlugins/index.js +2 -1
- package/dist/features/derivative.js +7 -5
- package/dist/features/routes.js +5 -0
- package/dist/features/sitemap.js +1 -1
- package/dist/features/theme/index.js +20 -0
- package/dist/loaders/markdown/transformer/rehypeDemo.js +1 -1
- package/dist/types.d.ts +15 -7
- package/package.json +1 -1
- package/theme-default/builtins/Badge/index.less +20 -0
- package/theme-default/builtins/Container/index.less +29 -28
- package/theme-default/builtins/Previewer/index.less +48 -1
- package/theme-default/builtins/SourceCode/index.less +40 -1
- package/theme-default/builtins/Table/index.less +2 -2
- package/theme-default/layouts/DocLayout/index.less +26 -0
- package/theme-default/locales/en-US.json +3 -1
- package/theme-default/locales/zh-CN.json +3 -1
- package/theme-default/slots/ColorSwitch/index.d.ts +4 -0
- package/theme-default/slots/ColorSwitch/index.js +82 -0
- package/theme-default/slots/ColorSwitch/index.less +58 -0
- package/theme-default/slots/Content/index.less +45 -0
- package/theme-default/slots/ContentTabs/index.less +20 -0
- package/theme-default/slots/Features/index.less +18 -0
- package/theme-default/slots/Footer/index.less +9 -0
- package/theme-default/slots/Header/index.js +6 -2
- package/theme-default/slots/Header/index.less +21 -0
- package/theme-default/slots/Hero/index.less +17 -0
- package/theme-default/slots/HeroTitle/index.less +4 -0
- package/theme-default/slots/LangSwitch/index.less +17 -1
- package/theme-default/slots/Logo/index.less +4 -0
- package/theme-default/slots/Navbar/index.less +12 -0
- package/theme-default/slots/NotFound/index.less +9 -0
- package/theme-default/slots/PreviewerActions/index.less +45 -1
- package/theme-default/slots/RtlSwitch/index.js +24 -4
- package/theme-default/slots/RtlSwitch/index.less +29 -3
- package/theme-default/slots/SearchBar/index.less +43 -0
- package/theme-default/slots/SearchResult/index.less +48 -2
- package/theme-default/slots/Sidebar/index.less +25 -0
- package/theme-default/slots/Toc/index.less +17 -0
- package/theme-default/styles/utils.less +14 -2
- package/theme-default/styles/variables.less +17 -0
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
margin: 24px 0 32px;
|
|
5
5
|
border: 1px solid @c-border-light;
|
|
6
6
|
border-radius: 4px;
|
|
7
|
-
background-color:
|
|
7
|
+
background-color: inherit;
|
|
8
|
+
|
|
9
|
+
@{dark-selector} & {
|
|
10
|
+
border-color: @c-border-less-dark;
|
|
11
|
+
}
|
|
8
12
|
|
|
9
13
|
[data-dumi-demo-grid] & {
|
|
10
14
|
margin: 0 0 16px;
|
|
@@ -41,6 +45,10 @@
|
|
|
41
45
|
display: block;
|
|
42
46
|
height: 24px;
|
|
43
47
|
background-color: @c-border-light;
|
|
48
|
+
|
|
49
|
+
@{dark-selector} & {
|
|
50
|
+
background-color: @c-border-less-dark;
|
|
51
|
+
}
|
|
44
52
|
}
|
|
45
53
|
|
|
46
54
|
&::after {
|
|
@@ -72,6 +80,10 @@
|
|
|
72
80
|
|
|
73
81
|
&-meta {
|
|
74
82
|
border-top: 1px solid @c-border-light;
|
|
83
|
+
|
|
84
|
+
@{dark-selector} & {
|
|
85
|
+
border-top-color: @c-border-less-dark;
|
|
86
|
+
}
|
|
75
87
|
}
|
|
76
88
|
|
|
77
89
|
&-desc {
|
|
@@ -80,6 +92,10 @@
|
|
|
80
92
|
> .markdown {
|
|
81
93
|
padding: 14px 24px;
|
|
82
94
|
border-bottom: 1px dashed @c-border-light;
|
|
95
|
+
|
|
96
|
+
@{dark-selector} & {
|
|
97
|
+
border-bottom-color: @c-border-less-dark;
|
|
98
|
+
}
|
|
83
99
|
}
|
|
84
100
|
|
|
85
101
|
> h5 {
|
|
@@ -100,9 +116,23 @@
|
|
|
100
116
|
)
|
|
101
117
|
100%;
|
|
102
118
|
|
|
119
|
+
@{dark-selector} & {
|
|
120
|
+
background: linear-gradient(
|
|
121
|
+
to top,
|
|
122
|
+
rgba(0, 0, 0, 95%),
|
|
123
|
+
rgba(0, 0, 0, 95%) 50%,
|
|
124
|
+
rgba(0, 0, 0, 0%)
|
|
125
|
+
)
|
|
126
|
+
100%;
|
|
127
|
+
}
|
|
128
|
+
|
|
103
129
|
> a {
|
|
104
130
|
color: @c-text;
|
|
105
131
|
|
|
132
|
+
@{dark-selector} & {
|
|
133
|
+
color: @c-text-dark;
|
|
134
|
+
}
|
|
135
|
+
|
|
106
136
|
&:not(:hover) {
|
|
107
137
|
text-decoration: none;
|
|
108
138
|
}
|
|
@@ -113,6 +143,10 @@
|
|
|
113
143
|
color: @c-warning;
|
|
114
144
|
font-size: 12px;
|
|
115
145
|
line-height: 15px;
|
|
146
|
+
|
|
147
|
+
@{dark-selector} & {
|
|
148
|
+
color: @c-warning-dark;
|
|
149
|
+
}
|
|
116
150
|
}
|
|
117
151
|
}
|
|
118
152
|
}
|
|
@@ -121,14 +155,27 @@
|
|
|
121
155
|
&[data-active] {
|
|
122
156
|
box-shadow: 0 0 0 4px fade(@c-primary, 10%);
|
|
123
157
|
border-color: lighten(@c-primary, 20%);
|
|
158
|
+
|
|
159
|
+
@{dark-selector} & {
|
|
160
|
+
box-shadow: 0 0 0 4px fade(@c-primary-dark, 10%);
|
|
161
|
+
border-color: darken(@c-primary-dark, 20%);
|
|
162
|
+
}
|
|
124
163
|
}
|
|
125
164
|
|
|
126
165
|
// debug mode
|
|
127
166
|
&[data-debug] {
|
|
128
167
|
border-color: lighten(@c-warning, 20%);
|
|
129
168
|
|
|
169
|
+
@{dark-selector} & {
|
|
170
|
+
border-color: darken(@c-warning-dark, 20%);
|
|
171
|
+
}
|
|
172
|
+
|
|
130
173
|
&[data-active] {
|
|
131
174
|
box-shadow: 0 0 0 4px fade(@c-warning, 10%);
|
|
175
|
+
|
|
176
|
+
@{dark-selector} & {
|
|
177
|
+
box-shadow: 0 0 0 4px fade(@c-warning-dark, 10%);
|
|
178
|
+
}
|
|
132
179
|
}
|
|
133
180
|
}
|
|
134
181
|
}
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
@import (reference) '../../styles/variables.less';
|
|
2
2
|
|
|
3
|
+
// override prism theme for dark mode
|
|
4
|
+
@{dark-selector} {
|
|
5
|
+
.token.doctype,
|
|
6
|
+
.token.punctuation,
|
|
7
|
+
.token.entity,
|
|
8
|
+
code[class*='language-'],
|
|
9
|
+
pre[class*='language-'] {
|
|
10
|
+
color: @c-text-secondary-dark;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.token.comment,
|
|
14
|
+
.token.prolog,
|
|
15
|
+
.token.cdata {
|
|
16
|
+
color: @c-text-note-dark;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
3
20
|
.@{prefix}-source-code {
|
|
4
21
|
@bg-color: tint(@c-site-bg, 50%);
|
|
5
22
|
|
|
@@ -39,14 +56,26 @@
|
|
|
39
56
|
width: 16px;
|
|
40
57
|
fill: darken(@c-border, 20%);
|
|
41
58
|
transition: fill 0.2s;
|
|
59
|
+
|
|
60
|
+
@{dark-selector} & {
|
|
61
|
+
fill: lighten(@c-border-dark, 20%);
|
|
62
|
+
}
|
|
42
63
|
}
|
|
43
64
|
|
|
44
65
|
&:hover > svg {
|
|
45
66
|
fill: darken(@c-border, 30%);
|
|
67
|
+
|
|
68
|
+
@{dark-selector} & {
|
|
69
|
+
fill: lighten(@c-border-dark, 30%);
|
|
70
|
+
}
|
|
46
71
|
}
|
|
47
72
|
|
|
48
73
|
&[data-copied] > svg {
|
|
49
|
-
fill:
|
|
74
|
+
fill: @c-success;
|
|
75
|
+
|
|
76
|
+
@{dark-selector} & {
|
|
77
|
+
fill: @c-success-dark;
|
|
78
|
+
}
|
|
50
79
|
}
|
|
51
80
|
}
|
|
52
81
|
|
|
@@ -54,4 +83,14 @@
|
|
|
54
83
|
opacity: 0;
|
|
55
84
|
visibility: hidden;
|
|
56
85
|
}
|
|
86
|
+
|
|
87
|
+
@{dark-selector} & {
|
|
88
|
+
@bg-color: shade(@c-site-bg-dark, 50%);
|
|
89
|
+
|
|
90
|
+
background-color: @bg-color;
|
|
91
|
+
|
|
92
|
+
&-copy {
|
|
93
|
+
background-color: fadeout(@bg-color, 80%);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
57
96
|
}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
rgba(0, 0, 0, 0%)
|
|
28
28
|
);
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
@{dark-selector} & {
|
|
31
31
|
background-image: linear-gradient(
|
|
32
32
|
to right,
|
|
33
33
|
rgba(0, 0, 0, 50%),
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
rgba(0, 0, 0, 0%)
|
|
45
45
|
);
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
@{dark-selector} & {
|
|
48
48
|
background-image: linear-gradient(
|
|
49
49
|
to left,
|
|
50
50
|
rgba(0, 0, 0, 50%),
|
|
@@ -3,12 +3,21 @@
|
|
|
3
3
|
body {
|
|
4
4
|
margin: 0;
|
|
5
5
|
padding: 0;
|
|
6
|
+
background-color: @c-site-bg;
|
|
7
|
+
|
|
8
|
+
@{dark-selector} & {
|
|
9
|
+
background-color: @c-site-bg-dark;
|
|
10
|
+
}
|
|
6
11
|
}
|
|
7
12
|
|
|
8
13
|
.@{prefix}-doc-layout {
|
|
9
14
|
font-family: sans-serif;
|
|
10
15
|
background-color: @c-site-bg;
|
|
11
16
|
|
|
17
|
+
@{dark-selector} & {
|
|
18
|
+
background-color: @c-site-bg-dark;
|
|
19
|
+
}
|
|
20
|
+
|
|
12
21
|
@media @mobile {
|
|
13
22
|
&::before {
|
|
14
23
|
content: '';
|
|
@@ -44,6 +53,11 @@ body {
|
|
|
44
53
|
background-color: fadeout(@c-site-bg, 10%);
|
|
45
54
|
backdrop-filter: blur(6px);
|
|
46
55
|
|
|
56
|
+
@{dark-selector} & {
|
|
57
|
+
border-top-color: @c-border-less-dark;
|
|
58
|
+
background-color: fadein(@c-site-bg-dark, 10%);
|
|
59
|
+
}
|
|
60
|
+
|
|
47
61
|
@media @mobile {
|
|
48
62
|
display: flex;
|
|
49
63
|
}
|
|
@@ -54,11 +68,19 @@ body {
|
|
|
54
68
|
border: 0;
|
|
55
69
|
background-color: transparent;
|
|
56
70
|
|
|
71
|
+
@{dark-selector} & {
|
|
72
|
+
color: @c-text-secondary-dark;
|
|
73
|
+
}
|
|
74
|
+
|
|
57
75
|
> svg {
|
|
58
76
|
width: 16px;
|
|
59
77
|
margin-right: 6px;
|
|
60
78
|
fill: @c-text-secondary;
|
|
61
79
|
vertical-align: middle;
|
|
80
|
+
|
|
81
|
+
@{dark-selector} & {
|
|
82
|
+
fill: @c-text-secondary-dark;
|
|
83
|
+
}
|
|
62
84
|
}
|
|
63
85
|
}
|
|
64
86
|
}
|
|
@@ -95,6 +117,10 @@ body {
|
|
|
95
117
|
color: @c-text-note;
|
|
96
118
|
font-size: 13px;
|
|
97
119
|
line-height: 1;
|
|
120
|
+
|
|
121
|
+
@{dark-selector} & {
|
|
122
|
+
color: @c-text-note-dark;
|
|
123
|
+
}
|
|
98
124
|
}
|
|
99
125
|
}
|
|
100
126
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"a": "A",
|
|
3
2
|
"header.search.placeholder": "Type keywords...",
|
|
3
|
+
"header.color.mode.light": "Light Mode",
|
|
4
|
+
"header.color.mode.dark": "Dark Mode",
|
|
5
|
+
"header.color.mode.auto": "Follow System",
|
|
4
6
|
"previewer.actions.code.expand": "Show Code",
|
|
5
7
|
"previewer.actions.code.shrink": "Hide Code",
|
|
6
8
|
"previewer.actions.codesandbox": "Open in CodeSandbox",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"a": "嘿",
|
|
3
2
|
"header.search.placeholder": "输入关键字搜索...",
|
|
3
|
+
"header.color.mode.light": "亮色模式",
|
|
4
|
+
"header.color.mode.dark": "暗色模式",
|
|
5
|
+
"header.color.mode.auto": "跟随系统",
|
|
4
6
|
"previewer.actions.code.expand": "展开代码",
|
|
5
7
|
"previewer.actions.code.shrink": "收起代码",
|
|
6
8
|
"previewer.actions.codesandbox": "在 CodeSandbox 中打开",
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
|
+
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
+
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
13
|
+
import { FormattedMessage, useIntl, usePrefersColor } from 'dumi';
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import "./index.less";
|
|
16
|
+
|
|
17
|
+
var IconDark = function IconDark() {
|
|
18
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
19
|
+
viewBox: "0 0 16 16"
|
|
20
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
21
|
+
d: "M8.218 1.455c3.527.109 6.327 3.018 6.327 6.545 0 3.6-2.945 6.545-6.545 6.545a6.562 6.562 0 0 1-6.036-4h.218c3.6 0 6.545-2.945 6.545-6.545 0-.91-.182-1.745-.509-2.545m0-1.455c-.473 0-.909.218-1.2.618-.29.4-.327.946-.145 1.382.254.655.4 1.31.4 2 0 2.8-2.291 5.09-5.091 5.09h-.218c-.473 0-.91.22-1.2.62-.291.4-.328.945-.146 1.38C1.891 14.074 4.764 16 8 16c4.4 0 8-3.6 8-8a7.972 7.972 0 0 0-7.745-8h-.037Z"
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var IconLight = function IconLight() {
|
|
26
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
27
|
+
viewBox: "0 0 16 16"
|
|
28
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
29
|
+
d: "M8 13a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0v-1a1 1 0 0 1 1-1ZM8 3a1 1 0 0 1-1-1V1a1 1 0 1 1 2 0v1a1 1 0 0 1-1 1Zm7 4a1 1 0 1 1 0 2h-1a1 1 0 1 1 0-2h1ZM3 8a1 1 0 0 1-1 1H1a1 1 0 1 1 0-2h1a1 1 0 0 1 1 1Zm9.95 3.536.707.707a1 1 0 0 1-1.414 1.414l-.707-.707a1 1 0 0 1 1.414-1.414Zm-9.9-7.072-.707-.707a1 1 0 0 1 1.414-1.414l.707.707A1 1 0 0 1 3.05 4.464Zm9.9 0a1 1 0 0 1-1.414-1.414l.707-.707a1 1 0 0 1 1.414 1.414l-.707.707Zm-9.9 7.072a1 1 0 0 1 1.414 1.414l-.707.707a1 1 0 0 1-1.414-1.414l.707-.707ZM8 4a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm0 6.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5Z"
|
|
30
|
+
}));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
var IconAuto = function IconAuto() {
|
|
34
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
35
|
+
viewBox: "0 0 16 16"
|
|
36
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
37
|
+
d: "M14.595 8a6.595 6.595 0 1 1-13.19 0 6.595 6.595 0 0 1 13.19 0ZM8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0Zm0 2.014v11.972A5.986 5.986 0 0 0 8 2.014Z"
|
|
38
|
+
}));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
var ICON_MAPPING = {
|
|
42
|
+
light: IconLight,
|
|
43
|
+
dark: IconDark,
|
|
44
|
+
auto: IconAuto
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var ColorSwitch = function ColorSwitch() {
|
|
48
|
+
var intl = useIntl();
|
|
49
|
+
|
|
50
|
+
var _usePrefersColor = usePrefersColor(),
|
|
51
|
+
_usePrefersColor2 = _slicedToArray(_usePrefersColor, 3),
|
|
52
|
+
prefersColor = _usePrefersColor2[1],
|
|
53
|
+
setPrefersColor = _usePrefersColor2[2];
|
|
54
|
+
|
|
55
|
+
var Icon = ICON_MAPPING[prefersColor];
|
|
56
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
57
|
+
className: "dumi-default-color-switch",
|
|
58
|
+
"data-dumi-tooltip": intl.formatMessage({
|
|
59
|
+
id: "header.color.mode.".concat(prefersColor)
|
|
60
|
+
}),
|
|
61
|
+
"data-dumi-tooltip-bottom": true
|
|
62
|
+
}, Icon && /*#__PURE__*/React.createElement(Icon, null), /*#__PURE__*/React.createElement("select", {
|
|
63
|
+
onChange: function onChange(ev) {
|
|
64
|
+
return setPrefersColor(ev.target.value);
|
|
65
|
+
},
|
|
66
|
+
value: prefersColor
|
|
67
|
+
}, /*#__PURE__*/React.createElement("option", {
|
|
68
|
+
value: "light"
|
|
69
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
70
|
+
id: "header.color.mode.light"
|
|
71
|
+
})), /*#__PURE__*/React.createElement("option", {
|
|
72
|
+
value: "dark"
|
|
73
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
74
|
+
id: "header.color.mode.dark"
|
|
75
|
+
})), /*#__PURE__*/React.createElement("option", {
|
|
76
|
+
value: "auto"
|
|
77
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
78
|
+
id: "header.color.mode.auto"
|
|
79
|
+
}))));
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export default ColorSwitch;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
@import (reference) '../../styles/variables.less';
|
|
2
|
+
|
|
3
|
+
.@{prefix}-color-switch {
|
|
4
|
+
position: relative;
|
|
5
|
+
font-size: 0;
|
|
6
|
+
line-height: 0;
|
|
7
|
+
|
|
8
|
+
@media screen and (max-width: 1430px) {
|
|
9
|
+
&::before {
|
|
10
|
+
left: auto;
|
|
11
|
+
right: auto;
|
|
12
|
+
inset-inline-end: -15px;
|
|
13
|
+
transform: none;
|
|
14
|
+
|
|
15
|
+
[class*='-switch'] + & {
|
|
16
|
+
inset-inline-end: 0;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
[class*='-switch'] + & {
|
|
22
|
+
margin-inline-start: 15px;
|
|
23
|
+
margin-inline-end: -15px;
|
|
24
|
+
padding-inline: 15px;
|
|
25
|
+
border-inline-start: 1px solid @c-border;
|
|
26
|
+
|
|
27
|
+
@{dark-selector} & {
|
|
28
|
+
border-inline-start-color: @c-border-dark;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
svg {
|
|
33
|
+
width: 16px;
|
|
34
|
+
fill: @c-text-secondary;
|
|
35
|
+
|
|
36
|
+
@{dark-selector} & {
|
|
37
|
+
fill: @c-text-secondary-dark;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:hover svg {
|
|
42
|
+
fill: @c-primary;
|
|
43
|
+
|
|
44
|
+
@{dark-selector} & {
|
|
45
|
+
fill: @c-primary-dark;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
select {
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: 0;
|
|
52
|
+
left: 0;
|
|
53
|
+
opacity: 0;
|
|
54
|
+
max-width: 100%;
|
|
55
|
+
max-height: 16px;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -3,13 +3,25 @@
|
|
|
3
3
|
.markdown {
|
|
4
4
|
color: @c-text;
|
|
5
5
|
|
|
6
|
+
@{dark-selector} & {
|
|
7
|
+
color: @c-text-dark;
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
// hyperlink
|
|
7
11
|
a {
|
|
8
12
|
color: @c-primary;
|
|
13
|
+
|
|
14
|
+
@{dark-selector} & {
|
|
15
|
+
color: @c-primary-dark;
|
|
16
|
+
}
|
|
9
17
|
}
|
|
10
18
|
|
|
11
19
|
img {
|
|
12
20
|
max-width: 100%;
|
|
21
|
+
|
|
22
|
+
@{dark-selector} & {
|
|
23
|
+
opacity: 0.8;
|
|
24
|
+
}
|
|
13
25
|
}
|
|
14
26
|
|
|
15
27
|
// inline code
|
|
@@ -18,6 +30,10 @@
|
|
|
18
30
|
color: #d56161;
|
|
19
31
|
background: darken(@c-site-bg, 2%);
|
|
20
32
|
border-radius: 2px;
|
|
33
|
+
|
|
34
|
+
@{dark-selector} & {
|
|
35
|
+
background: lighten(@c-site-bg-dark, 5%);
|
|
36
|
+
}
|
|
21
37
|
}
|
|
22
38
|
|
|
23
39
|
// pre tag
|
|
@@ -26,6 +42,10 @@
|
|
|
26
42
|
padding-left: 24px;
|
|
27
43
|
padding-right: 24px;
|
|
28
44
|
background-color: tint(@c-site-bg, 50%);
|
|
45
|
+
|
|
46
|
+
@{dark-selector} & {
|
|
47
|
+
background-color: shade(@c-site-bg-dark, 50%);
|
|
48
|
+
}
|
|
29
49
|
}
|
|
30
50
|
|
|
31
51
|
// table
|
|
@@ -35,6 +55,10 @@
|
|
|
35
55
|
|
|
36
56
|
th {
|
|
37
57
|
background-color: tint(@c-site-bg, 50%);
|
|
58
|
+
|
|
59
|
+
@{dark-selector} & {
|
|
60
|
+
background-color: shade(@c-site-bg-dark, 50%);
|
|
61
|
+
}
|
|
38
62
|
}
|
|
39
63
|
|
|
40
64
|
th,
|
|
@@ -44,6 +68,10 @@
|
|
|
44
68
|
padding-inline-start: 16px;
|
|
45
69
|
padding-inline-end: 16px;
|
|
46
70
|
border-color: @c-border-light;
|
|
71
|
+
|
|
72
|
+
@{dark-selector} & {
|
|
73
|
+
border-color: @c-border-less-dark;
|
|
74
|
+
}
|
|
47
75
|
}
|
|
48
76
|
|
|
49
77
|
// blockquote
|
|
@@ -53,6 +81,11 @@
|
|
|
53
81
|
margin-inline-end: 0;
|
|
54
82
|
background-color: tint(@c-site-bg, 50%);
|
|
55
83
|
border-left: 5px solid @c-border-light;
|
|
84
|
+
|
|
85
|
+
@{dark-selector} & {
|
|
86
|
+
background-color: shade(@c-site-bg-dark, 50%);
|
|
87
|
+
border-left-color: @c-border-less-dark;
|
|
88
|
+
}
|
|
56
89
|
}
|
|
57
90
|
|
|
58
91
|
// list
|
|
@@ -78,6 +111,10 @@
|
|
|
78
111
|
text-align: right;
|
|
79
112
|
line-height: inherit;
|
|
80
113
|
|
|
114
|
+
@{dark-selector} & {
|
|
115
|
+
color: @c-text-dark;
|
|
116
|
+
}
|
|
117
|
+
|
|
81
118
|
[data-direction='rtl'] & {
|
|
82
119
|
float: right;
|
|
83
120
|
}
|
|
@@ -90,6 +127,10 @@
|
|
|
90
127
|
content: '#';
|
|
91
128
|
color: @c-text-secondary;
|
|
92
129
|
font-size: 20px;
|
|
130
|
+
|
|
131
|
+
@{dark-selector} & {
|
|
132
|
+
color: @c-text-secondary-dark;
|
|
133
|
+
}
|
|
93
134
|
}
|
|
94
135
|
}
|
|
95
136
|
|
|
@@ -112,6 +153,10 @@
|
|
|
112
153
|
border-top-right-radius: 10px;
|
|
113
154
|
box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 5%);
|
|
114
155
|
|
|
156
|
+
@{dark-selector} & {
|
|
157
|
+
background-color: lighten(@c-site-bg-dark, 3%);
|
|
158
|
+
}
|
|
159
|
+
|
|
115
160
|
@media @mobile {
|
|
116
161
|
max-width: initial;
|
|
117
162
|
margin: 0 -24px;
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
padding: 0 @s-content-padding;
|
|
10
10
|
border-bottom: 1px solid @c-border-light;
|
|
11
11
|
|
|
12
|
+
@{dark-selector} & {
|
|
13
|
+
border-bottom-color: @c-border-less-dark;
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
@media @mobile {
|
|
13
17
|
margin: -24px -24px 24px;
|
|
14
18
|
padding: 0 24px;
|
|
@@ -37,8 +41,16 @@
|
|
|
37
41
|
cursor: pointer;
|
|
38
42
|
transition: all 0.2s;
|
|
39
43
|
|
|
44
|
+
@{dark-selector} & {
|
|
45
|
+
color: @c-text-secondary-dark;
|
|
46
|
+
}
|
|
47
|
+
|
|
40
48
|
&:hover {
|
|
41
49
|
color: @c-primary;
|
|
50
|
+
|
|
51
|
+
@{dark-selector} & {
|
|
52
|
+
color: @c-primary-dark;
|
|
53
|
+
}
|
|
42
54
|
}
|
|
43
55
|
}
|
|
44
56
|
|
|
@@ -55,6 +67,10 @@
|
|
|
55
67
|
|
|
56
68
|
> button {
|
|
57
69
|
color: @c-text;
|
|
70
|
+
|
|
71
|
+
@{dark-selector} & {
|
|
72
|
+
color: @c-text-dark;
|
|
73
|
+
}
|
|
58
74
|
}
|
|
59
75
|
|
|
60
76
|
&::after {
|
|
@@ -65,6 +81,10 @@
|
|
|
65
81
|
bottom: -1px;
|
|
66
82
|
height: 1px;
|
|
67
83
|
background-color: @c-primary;
|
|
84
|
+
|
|
85
|
+
@{dark-selector} & {
|
|
86
|
+
background-color: @c-primary-dark;
|
|
87
|
+
}
|
|
68
88
|
}
|
|
69
89
|
}
|
|
70
90
|
}
|
|
@@ -51,8 +51,18 @@
|
|
|
51
51
|
color: @c-text;
|
|
52
52
|
font-weight: normal;
|
|
53
53
|
font-size: 20px;
|
|
54
|
+
|
|
55
|
+
@{dark-selector} & {
|
|
56
|
+
color: @c-text-dark;
|
|
57
|
+
}
|
|
58
|
+
|
|
54
59
|
a {
|
|
55
60
|
color: @c-primary;
|
|
61
|
+
|
|
62
|
+
@{dark-selector} & {
|
|
63
|
+
color: @c-primary-dark;
|
|
64
|
+
}
|
|
65
|
+
|
|
56
66
|
&:not(:hover) {
|
|
57
67
|
text-decoration: none;
|
|
58
68
|
}
|
|
@@ -69,6 +79,10 @@
|
|
|
69
79
|
font-size: 16px;
|
|
70
80
|
line-height: 1.475;
|
|
71
81
|
|
|
82
|
+
@{dark-selector} & {
|
|
83
|
+
color: @c-text-secondary-dark;
|
|
84
|
+
}
|
|
85
|
+
|
|
72
86
|
@media @mobile {
|
|
73
87
|
font-size: 14px;
|
|
74
88
|
}
|
|
@@ -76,6 +90,10 @@
|
|
|
76
90
|
a {
|
|
77
91
|
color: @c-primary;
|
|
78
92
|
|
|
93
|
+
@{dark-selector} & {
|
|
94
|
+
color: @c-primary-dark;
|
|
95
|
+
}
|
|
96
|
+
|
|
79
97
|
&:not(:hover) {
|
|
80
98
|
text-decoration: none;
|
|
81
99
|
}
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
text-align: center;
|
|
10
10
|
padding: @s-content-padding * 0.6 0;
|
|
11
11
|
|
|
12
|
+
@{dark-selector} & {
|
|
13
|
+
border-top-color: @c-border-less-dark;
|
|
14
|
+
color: @c-text-note-dark;
|
|
15
|
+
}
|
|
16
|
+
|
|
12
17
|
@media @mobile {
|
|
13
18
|
padding: @s-content-padding * 0.3 0;
|
|
14
19
|
font-size: 13px;
|
|
@@ -17,6 +22,10 @@
|
|
|
17
22
|
a {
|
|
18
23
|
color: @c-primary;
|
|
19
24
|
|
|
25
|
+
@{dark-selector} & {
|
|
26
|
+
color: @c-primary-dark;
|
|
27
|
+
}
|
|
28
|
+
|
|
20
29
|
&:not(:hover) {
|
|
21
30
|
text-decoration: none;
|
|
22
31
|
}
|
|
@@ -13,7 +13,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
13
13
|
import HeaderExtra from "../HeadeExtra";
|
|
14
14
|
import { ReactComponent as IconClose } from '@ant-design/icons-svg/inline-svg/outlined/close.svg';
|
|
15
15
|
import { ReactComponent as IconMenu } from '@ant-design/icons-svg/inline-svg/outlined/menu.svg';
|
|
16
|
-
import { useRouteMeta } from 'dumi';
|
|
16
|
+
import { useRouteMeta, useSiteData } from 'dumi';
|
|
17
|
+
import ColorSwitch from "dumi/theme/slots/ColorSwitch";
|
|
17
18
|
import LangSwitch from "dumi/theme/slots/LangSwitch";
|
|
18
19
|
import Logo from "dumi/theme/slots/Logo";
|
|
19
20
|
import Navbar from "dumi/theme/slots/Navbar";
|
|
@@ -31,6 +32,9 @@ var Header = function Header() {
|
|
|
31
32
|
showMenu = _useState2[0],
|
|
32
33
|
setShowMenu = _useState2[1];
|
|
33
34
|
|
|
35
|
+
var _useSiteData = useSiteData(),
|
|
36
|
+
themeConfig = _useSiteData.themeConfig;
|
|
37
|
+
|
|
34
38
|
return /*#__PURE__*/React.createElement("div", {
|
|
35
39
|
className: "dumi-default-header",
|
|
36
40
|
"data-static": Boolean(frontmatter.hero) || undefined,
|
|
@@ -46,7 +50,7 @@ var Header = function Header() {
|
|
|
46
50
|
className: "dumi-default-header-right"
|
|
47
51
|
}, /*#__PURE__*/React.createElement(Navbar, null), /*#__PURE__*/React.createElement("div", {
|
|
48
52
|
className: "dumi-default-header-right-aside"
|
|
49
|
-
}, /*#__PURE__*/React.createElement(SearchBar, null), /*#__PURE__*/React.createElement(LangSwitch, null), /*#__PURE__*/React.createElement(RtlSwitch, null), /*#__PURE__*/React.createElement(HeaderExtra, null))), /*#__PURE__*/React.createElement("button", {
|
|
53
|
+
}, /*#__PURE__*/React.createElement(SearchBar, null), /*#__PURE__*/React.createElement(LangSwitch, null), /*#__PURE__*/React.createElement(RtlSwitch, null), themeConfig.prefersColor.switch && /*#__PURE__*/React.createElement(ColorSwitch, null), /*#__PURE__*/React.createElement(HeaderExtra, null))), /*#__PURE__*/React.createElement("button", {
|
|
50
54
|
type: "button",
|
|
51
55
|
className: "dumi-default-header-menu-btn",
|
|
52
56
|
onClick: function onClick(ev) {
|