@umijs/plugin-docs 4.0.0-rc.11 → 4.0.0-rc.14
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/client/theme-doc/Head.tsx +28 -16
- package/client/theme-doc/Layout.tsx +28 -23
- package/client/theme-doc/Logo.tsx +9 -5
- package/client/theme-doc/NavBar.tsx +58 -15
- package/client/theme-doc/Search.tsx +40 -21
- package/client/theme-doc/Sidebar.tsx +4 -2
- package/client/theme-doc/ThemeSwitch.tsx +8 -0
- package/client/theme-doc/Toc.tsx +12 -14
- package/client/theme-doc/components/Features.tsx +1 -1
- package/client/theme-doc/components/Message.tsx +31 -19
- package/client/theme-doc/context.ts +7 -1
- package/client/theme-doc/tailwind.css +125 -27
- package/client/theme-doc/tailwind.out.css +450 -134
- package/client/theme-doc/utils/getLinkFromTitle.ts +15 -0
- package/client/theme-doc/utils/getTocTitle.ts +9 -0
- package/compiled/@mdx-js/mdx/index.js +1 -1
- package/compiled/remark-gfm/LICENSE +22 -0
- package/compiled/remark-gfm/index.js +1 -0
- package/compiled/remark-gfm/package.json +1 -0
- package/dist/compiler.js +33 -4
- package/dist/index.js +3 -3
- package/dist/loader.js +13 -4
- package/package.json +15 -9
|
@@ -36,7 +36,7 @@ article ul {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
article li {
|
|
39
|
-
@apply mt-2 dark:text-white;
|
|
39
|
+
@apply text-base mt-2 leading-7 text-gray-700 dark:text-white;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
article ol {
|
|
@@ -51,44 +51,130 @@ article h2 a {
|
|
|
51
51
|
@apply no-underline dark:text-white;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
/* 行内代码 */
|
|
54
55
|
article code {
|
|
55
|
-
@apply bg-
|
|
56
|
+
@apply text-sky-600 dark:text-sky-300 bg-slate-800 bg-opacity-5 dark:bg-opacity-100 border border-black border-opacity-5 rounded-md;
|
|
56
57
|
font-size: 0.9em;
|
|
57
58
|
padding: 2px 0.25em;
|
|
58
59
|
box-decoration-break: clone;
|
|
59
60
|
font-feature-settings: 'rlig' 1, 'calt' 1, 'ss01' 1;
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
/* 行内高亮代码 */
|
|
64
|
+
article span[data-rehype-pretty-code-fragment] code {
|
|
65
|
+
@apply bg-zinc-900 dark:bg-zinc-900;
|
|
64
66
|
}
|
|
65
67
|
|
|
68
|
+
/* 代码块 */
|
|
66
69
|
article pre {
|
|
67
|
-
/* content-visibility: auto; */
|
|
68
70
|
contain: paint;
|
|
69
|
-
@apply
|
|
71
|
+
@apply my-4 bg-zinc-900 dark:bg-zinc-900 text-neutral-300 dark:text-neutral-300 rounded-md font-medium subpixel-antialiased transition;
|
|
72
|
+
}
|
|
73
|
+
article pre > code {
|
|
74
|
+
@apply grid leading-relaxed p-4 text-sm text-neutral-300 dark:text-neutral-300 bg-transparent dark:bg-transparent rounded-none border-none min-w-full overflow-x-auto;
|
|
75
|
+
}
|
|
76
|
+
article div[data-rehype-pretty-code-fragment] {
|
|
77
|
+
@apply my-4;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* 代码块的标题部分 */
|
|
81
|
+
article
|
|
82
|
+
div[data-rehype-pretty-code-fragment]
|
|
83
|
+
> div[data-rehype-pretty-code-title] {
|
|
84
|
+
@apply pb-1 text-sm text-zinc-400 dark:text-neutral-400 text-center;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* 代码块的代码部分 */
|
|
88
|
+
article div[data-rehype-pretty-code-fragment] > pre {
|
|
89
|
+
@apply pt-6 my-0;
|
|
90
|
+
}
|
|
91
|
+
article div[data-rehype-pretty-code-fragment] > pre > code {
|
|
92
|
+
@apply my-0 pt-0 px-0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* 代码块的使用语言 */
|
|
96
|
+
article div[data-rehype-pretty-code-fragment] > pre::before {
|
|
97
|
+
@apply fixed top-0 right-0 px-2 text-sm uppercase bg-neutral-300 text-zinc-900 bg-opacity-80 dark:bg-opacity-60 rounded-sm;
|
|
98
|
+
content: attr(data-language);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* 代码块的代码行 */
|
|
102
|
+
article div[data-rehype-pretty-code-fragment] > pre > code .line {
|
|
103
|
+
@apply pl-3 pr-4;
|
|
70
104
|
}
|
|
71
105
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
@apply
|
|
106
|
+
/* 代码块的行内高亮文字 */
|
|
107
|
+
article div[data-rehype-pretty-code-fragment] > pre > code .line .word {
|
|
108
|
+
@apply px-1.5 inline-block bg-neutral-300 bg-opacity-20 rounded-sm;
|
|
75
109
|
}
|
|
76
110
|
|
|
77
|
-
|
|
78
|
-
|
|
111
|
+
/* 代码块的行号 */
|
|
112
|
+
article div[data-rehype-pretty-code-fragment] > pre > code {
|
|
113
|
+
counter-reset: line;
|
|
114
|
+
}
|
|
115
|
+
article div[data-rehype-pretty-code-fragment] > pre > code > .line::before {
|
|
116
|
+
@apply text-neutral-600 w-4 mr-4 inline-block text-right;
|
|
117
|
+
counter-increment: line;
|
|
118
|
+
content: counter(line);
|
|
79
119
|
}
|
|
80
120
|
|
|
81
|
-
|
|
82
|
-
|
|
121
|
+
/* 代码块的高亮行 */
|
|
122
|
+
article div[data-rehype-pretty-code-fragment] pre > code > .line {
|
|
123
|
+
@apply border-l-2 border-transparent;
|
|
124
|
+
}
|
|
125
|
+
article div[data-rehype-pretty-code-fragment] pre > code > .line.highlighted {
|
|
126
|
+
@apply bg-neutral-100 dark:bg-neutral-300 bg-opacity-10 dark:bg-opacity-10 border-l-blue-400 dark:border-l-sky-600;
|
|
83
127
|
}
|
|
84
128
|
|
|
129
|
+
/* 链接 */
|
|
85
130
|
article a {
|
|
86
|
-
@apply text-
|
|
131
|
+
@apply mx-1 text-cyan-600 dark:text-fuchsia-200 hover:text-cyan-900 dark:hover:text-fuchsia-400 transition;
|
|
132
|
+
background-image: linear-gradient(
|
|
133
|
+
transparent 60%,
|
|
134
|
+
rgba(130, 199, 255, 0.28) 55%
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
.dark article a {
|
|
138
|
+
background-image: linear-gradient(
|
|
139
|
+
transparent 60%,
|
|
140
|
+
rgba(238, 157, 234, 0.28) 55%
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* 行内代码块链接 */
|
|
145
|
+
article a > code {
|
|
146
|
+
@apply text-cyan-600 dark:text-fuchsia-200 hover:text-cyan-900 dark:hover:text-fuchsia-400 transition;
|
|
87
147
|
background-image: linear-gradient(
|
|
88
148
|
transparent 60%,
|
|
89
149
|
rgba(130, 199, 255, 0.28) 55%
|
|
90
150
|
);
|
|
91
151
|
}
|
|
152
|
+
.dark article a > code {
|
|
153
|
+
background-image: linear-gradient(
|
|
154
|
+
transparent 60%,
|
|
155
|
+
rgba(238, 157, 234, 0.28) 55%
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
article table {
|
|
160
|
+
@apply table-auto w-full shadow rounded-xl text-left overflow-hidden dark:shadow-gray-800 my-8;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
article table thead {
|
|
164
|
+
@apply bg-blue-100 dark:bg-gray-800;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
article table thead th {
|
|
168
|
+
@apply py-3 px-4 text-gray-700 dark:text-white;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
article table tbody tr {
|
|
172
|
+
@apply border-b border-b-zinc-100 dark:border-b-gray-600;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
article table tbody td {
|
|
176
|
+
@apply py-2 px-4 text-gray-700 dark:text-white;
|
|
177
|
+
}
|
|
92
178
|
|
|
93
179
|
.link-with-underline {
|
|
94
180
|
@apply text-blue-600 mx-1 hover:text-blue-300 transition dark:text-blue-400;
|
|
@@ -161,39 +247,51 @@ h6 {
|
|
|
161
247
|
@apply border-l-8;
|
|
162
248
|
}
|
|
163
249
|
|
|
164
|
-
.mdx-message
|
|
250
|
+
.mdx-message code {
|
|
251
|
+
@apply dark:bg-opacity-50;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.mdx-message-text :first-child {
|
|
165
255
|
@apply mt-0;
|
|
166
256
|
}
|
|
167
257
|
|
|
258
|
+
.mdx-message-text img {
|
|
259
|
+
@apply rounded-md;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.mdx-message-text pre {
|
|
263
|
+
@apply my-2;
|
|
264
|
+
}
|
|
265
|
+
|
|
168
266
|
.mdx-message-info {
|
|
169
|
-
@apply bg-blue-50 border-blue-300 dark:bg-blue-
|
|
267
|
+
@apply bg-blue-50 border-blue-300 dark:bg-blue-900 dark:border-blue-500;
|
|
170
268
|
}
|
|
171
269
|
|
|
172
|
-
.mdx-message-info
|
|
173
|
-
@apply text-blue-
|
|
270
|
+
.mdx-message-info code {
|
|
271
|
+
@apply text-blue-800 dark:text-blue-200;
|
|
174
272
|
}
|
|
175
273
|
|
|
176
274
|
.mdx-message-success {
|
|
177
|
-
@apply bg-green-50 border-green-300 dark:bg-green-
|
|
275
|
+
@apply bg-green-50 border-green-300 dark:bg-green-700 dark:border-green-500;
|
|
178
276
|
}
|
|
179
277
|
|
|
180
|
-
.mdx-message-success
|
|
181
|
-
@apply text-green-
|
|
278
|
+
.mdx-message-success code {
|
|
279
|
+
@apply text-green-800 dark:text-green-200;
|
|
182
280
|
}
|
|
183
281
|
|
|
184
282
|
.mdx-message-warning {
|
|
185
|
-
@apply bg-orange-50 border-orange-300 dark:bg-orange-
|
|
283
|
+
@apply bg-orange-50 border-orange-300 dark:bg-orange-700 dark:border-orange-500;
|
|
186
284
|
}
|
|
187
285
|
|
|
188
|
-
.mdx-message-warning
|
|
189
|
-
@apply text-orange-
|
|
286
|
+
.mdx-message-warning code {
|
|
287
|
+
@apply text-orange-700 dark:text-orange-100;
|
|
190
288
|
}
|
|
191
289
|
|
|
192
290
|
.mdx-message-error {
|
|
193
|
-
@apply bg-red-50 border-red-300 dark:bg-
|
|
291
|
+
@apply bg-red-50 border-red-300 dark:bg-rose-700 dark:border-rose-500;
|
|
194
292
|
}
|
|
195
293
|
|
|
196
|
-
.mdx-message-error
|
|
197
|
-
@apply text-red-
|
|
294
|
+
.mdx-message-error code {
|
|
295
|
+
@apply text-red-700 dark:text-rose-100;
|
|
198
296
|
}
|
|
199
297
|
}
|