@umijs/plugin-docs 4.0.0-rc.12 → 4.0.0-rc.15

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.
@@ -12,9 +12,9 @@
12
12
  .g-glossy-firefox-cover {
13
13
  display: block;
14
14
  position: fixed;
15
- top: var(--anchor-offset);
15
+ top: 0;
16
16
  width: 100%;
17
- height: 72px;
17
+ height: calc(var(--anchor-offset) + 72px);
18
18
  z-index: 22;
19
19
  background-color: white;
20
20
  }
@@ -23,8 +23,8 @@
23
23
  display: block;
24
24
  position: fixed;
25
25
  width: 100%;
26
- top: var(--anchor-offset);
27
- height: 72px;
26
+ top: 0;
27
+ height: calc(var(--anchor-offset) + 72px);
28
28
  z-index: 24;
29
29
  background: -moz-element(#article-body) no-repeat top;
30
30
  filter: blur(10px);
@@ -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,63 +51,129 @@ article h2 a {
51
51
  @apply no-underline dark:text-white;
52
52
  }
53
53
 
54
+ /* 行内代码 */
54
55
  article code {
55
- @apply bg-black bg-opacity-5 border border-black border-opacity-5 rounded-md dark:text-white;
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
- article inlinecode {
63
- @apply bg-black bg-opacity-5 border border-black border-opacity-5 rounded-md px-1.5 py-0.5 text-xs dark:text-white dark:bg-gray-700;
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 p-4 bg-slate-100 dark:bg-slate-800 rounded-xl my-8 overflow-x-auto font-medium subpixel-antialiased dark:text-white;
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;
70
78
  }
71
79
 
72
- article pre code {
73
- line-height: 1.25rem;
74
- @apply relative p-0 text-sm text-current bg-transparent rounded-none border-none inline-block min-w-full dark:text-white;
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;
75
93
  }
76
94
 
77
- article pre code .line.highlighted {
78
- @apply before:block before:absolute before:h-5 before:bg-gray-500 before:bg-opacity-10 before:-inset-x-4 before:pointer-events-none before:select-none dark:text-white;
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);
79
99
  }
80
100
 
81
- article a code {
82
- @apply text-current no-underline dark:text-white;
101
+ /* 代码块的代码行 */
102
+ article div[data-rehype-pretty-code-fragment] > pre > code .line {
103
+ @apply pl-3 pr-4;
83
104
  }
84
105
 
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;
109
+ }
110
+
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);
119
+ }
120
+
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;
127
+ }
128
+
129
+ /* 链接 */
85
130
  article a {
86
- @apply text-blue-600 mx-1 hover:text-blue-300 transition dark:text-blue-400;
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
+ }
92
158
 
93
159
  article table {
94
- @apply table-auto w-full shadow rounded-xl text-left overflow-hidden dark:shadow-gray-800 my-8
160
+ @apply table-auto w-full shadow rounded-xl text-left overflow-hidden dark:shadow-gray-800 my-8;
95
161
  }
96
162
 
97
163
  article table thead {
98
- @apply bg-blue-100 dark:bg-gray-800
164
+ @apply bg-blue-100 dark:bg-gray-800;
99
165
  }
100
166
 
101
167
  article table thead th {
102
- @apply py-3 px-4 text-gray-700 dark:text-white
168
+ @apply py-3 px-4 text-gray-700 dark:text-white;
103
169
  }
104
170
 
105
171
  article table tbody tr {
106
- @apply border-b border-b-zinc-100 dark:border-b-gray-600
172
+ @apply border-b border-b-zinc-100 dark:border-b-gray-600;
107
173
  }
108
174
 
109
175
  article table tbody td {
110
- @apply py-2 px-4 text-gray-700 dark:text-white
176
+ @apply py-2 px-4 text-gray-700 dark:text-white;
111
177
  }
112
178
 
113
179
  .link-with-underline {
@@ -181,39 +247,51 @@ h6 {
181
247
  @apply border-l-8;
182
248
  }
183
249
 
184
- .mdx-message > p {
250
+ .mdx-message code {
251
+ @apply dark:bg-opacity-50;
252
+ }
253
+
254
+ .mdx-message-text :first-child {
185
255
  @apply mt-0;
186
256
  }
187
257
 
258
+ .mdx-message-text img {
259
+ @apply rounded-md;
260
+ }
261
+
262
+ .mdx-message-text pre {
263
+ @apply my-2;
264
+ }
265
+
188
266
  .mdx-message-info {
189
- @apply bg-blue-50 border-blue-300 dark:bg-blue-100 dark:border-blue-500;
267
+ @apply bg-blue-50 border-blue-300 dark:bg-blue-900 dark:border-blue-500;
190
268
  }
191
269
 
192
- .mdx-message-info > p {
193
- @apply text-blue-900 dark:text-blue-900;
270
+ .mdx-message-info code {
271
+ @apply text-blue-800 dark:text-blue-200;
194
272
  }
195
273
 
196
274
  .mdx-message-success {
197
- @apply bg-green-50 border-green-300 dark:bg-green-100 dark:border-green-500;
275
+ @apply bg-green-50 border-green-300 dark:bg-green-700 dark:border-green-500;
198
276
  }
199
277
 
200
- .mdx-message-success > p {
201
- @apply text-green-900 dark:text-green-900;
278
+ .mdx-message-success code {
279
+ @apply text-green-800 dark:text-green-200;
202
280
  }
203
281
 
204
282
  .mdx-message-warning {
205
- @apply bg-orange-50 border-orange-300 dark:bg-orange-100 dark:border-orange-500;
283
+ @apply bg-orange-50 border-orange-300 dark:bg-orange-700 dark:border-orange-500;
206
284
  }
207
285
 
208
- .mdx-message-warning > p {
209
- @apply text-orange-900 dark:text-orange-900;
286
+ .mdx-message-warning code {
287
+ @apply text-orange-700 dark:text-orange-100;
210
288
  }
211
289
 
212
290
  .mdx-message-error {
213
- @apply bg-red-50 border-red-300 dark:bg-red-100 dark:border-red-500;
291
+ @apply bg-red-50 border-red-300 dark:bg-rose-700 dark:border-rose-500;
214
292
  }
215
293
 
216
- .mdx-message-error > p {
217
- @apply text-red-900 dark:text-red-900;
294
+ .mdx-message-error code {
295
+ @apply text-red-700 dark:text-rose-100;
218
296
  }
219
297
  }