@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.
@@ -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-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;
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
- 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;
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
- 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;
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
- article a code {
82
- @apply text-current no-underline dark:text-white;
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-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
+ }
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 > p {
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-100 dark:border-blue-500;
267
+ @apply bg-blue-50 border-blue-300 dark:bg-blue-900 dark:border-blue-500;
170
268
  }
171
269
 
172
- .mdx-message-info > p {
173
- @apply text-blue-900 dark:text-blue-900;
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-100 dark:border-green-500;
275
+ @apply bg-green-50 border-green-300 dark:bg-green-700 dark:border-green-500;
178
276
  }
179
277
 
180
- .mdx-message-success > p {
181
- @apply text-green-900 dark:text-green-900;
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-100 dark:border-orange-500;
283
+ @apply bg-orange-50 border-orange-300 dark:bg-orange-700 dark:border-orange-500;
186
284
  }
187
285
 
188
- .mdx-message-warning > p {
189
- @apply text-orange-900 dark:text-orange-900;
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-red-100 dark:border-red-500;
291
+ @apply bg-red-50 border-red-300 dark:bg-rose-700 dark:border-rose-500;
194
292
  }
195
293
 
196
- .mdx-message-error > p {
197
- @apply text-red-900 dark:text-red-900;
294
+ .mdx-message-error code {
295
+ @apply text-red-700 dark:text-rose-100;
198
296
  }
199
297
  }