Spaces:
Sleeping
Sleeping
拯救一下之前的灾难性的代码配色
Browse files
theme.py
CHANGED
@@ -137,6 +137,15 @@ advanced_css = """
|
|
137 |
|
138 |
/* 行内代码的背景设为淡灰色,设定圆角和间距. */
|
139 |
.markdown-body code {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
display: inline;
|
141 |
white-space: break-spaces;
|
142 |
border-radius: 6px;
|
@@ -144,8 +153,19 @@ advanced_css = """
|
|
144 |
padding: .2em .4em .1em .4em;
|
145 |
background-color: rgba(175,184,193,0.2);
|
146 |
}
|
|
|
147 |
/* 设定代码块的样式,包括背景颜色、内、外边距、圆角。 */
|
148 |
.markdown-body pre code {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
display: block;
|
150 |
overflow: auto;
|
151 |
white-space: pre;
|
@@ -160,72 +180,162 @@ advanced_css = """
|
|
160 |
if CODE_HIGHLIGHT:
|
161 |
advanced_css += """
|
162 |
|
163 |
-
.hll { background-color: #
|
164 |
-
.c { color: #
|
165 |
-
.err {
|
166 |
-
.
|
167 |
-
.
|
168 |
-
.
|
169 |
-
.
|
170 |
-
.
|
171 |
-
.
|
172 |
-
.
|
173 |
-
.
|
174 |
-
.
|
175 |
-
.
|
176 |
-
.
|
177 |
-
.
|
178 |
-
.
|
179 |
-
.
|
180 |
-
.
|
181 |
-
.
|
182 |
-
.
|
183 |
-
.
|
184 |
-
.
|
185 |
-
.
|
186 |
-
.
|
187 |
-
.
|
188 |
-
.
|
189 |
-
.
|
190 |
-
.
|
191 |
-
.
|
192 |
-
.
|
193 |
-
.
|
194 |
-
.
|
195 |
-
.
|
196 |
-
.
|
197 |
-
.
|
198 |
-
.
|
199 |
-
.
|
200 |
-
.
|
201 |
-
.
|
202 |
-
.
|
203 |
-
.
|
204 |
-
.
|
205 |
-
.
|
206 |
-
.
|
207 |
-
.
|
208 |
-
.
|
209 |
-
.
|
210 |
-
.
|
211 |
-
.
|
212 |
-
.
|
213 |
-
.
|
214 |
-
.
|
215 |
-
.
|
216 |
-
.
|
217 |
-
.
|
218 |
-
.
|
219 |
-
.
|
220 |
-
.
|
221 |
-
.
|
222 |
-
.
|
223 |
-
.
|
224 |
-
.
|
225 |
-
.
|
226 |
-
.
|
227 |
-
.
|
228 |
-
.
|
229 |
-
.
|
230 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
"""
|
|
|
137 |
|
138 |
/* 行内代码的背景设为淡灰色,设定圆角和间距. */
|
139 |
.markdown-body code {
|
140 |
+
display: inline;
|
141 |
+
white-space: break-spaces;
|
142 |
+
border-radius: 6px;
|
143 |
+
margin: 0 2px 0 2px;
|
144 |
+
padding: .2em .4em .1em .4em;
|
145 |
+
background-color: rgba(13, 17, 23, 0.95);
|
146 |
+
}
|
147 |
+
|
148 |
+
.dark .markdown-body code {
|
149 |
display: inline;
|
150 |
white-space: break-spaces;
|
151 |
border-radius: 6px;
|
|
|
153 |
padding: .2em .4em .1em .4em;
|
154 |
background-color: rgba(175,184,193,0.2);
|
155 |
}
|
156 |
+
|
157 |
/* 设定代码块的样式,包括背景颜色、内、外边距、圆角。 */
|
158 |
.markdown-body pre code {
|
159 |
+
display: block;
|
160 |
+
overflow: auto;
|
161 |
+
white-space: pre;
|
162 |
+
background-color: rgba(13, 17, 23, 0.95);
|
163 |
+
border-radius: 10px;
|
164 |
+
padding: 1em;
|
165 |
+
margin: 1em 2em 1em 0.5em;
|
166 |
+
}
|
167 |
+
|
168 |
+
.dark .markdown-body pre code {
|
169 |
display: block;
|
170 |
overflow: auto;
|
171 |
white-space: pre;
|
|
|
180 |
if CODE_HIGHLIGHT:
|
181 |
advanced_css += """
|
182 |
|
183 |
+
.codehilite .hll { background-color: #6e7681 }
|
184 |
+
.codehilite .c { color: #8b949e; font-style: italic } /* Comment */
|
185 |
+
.codehilite .err { color: #f85149 } /* Error */
|
186 |
+
.codehilite .esc { color: #c9d1d9 } /* Escape */
|
187 |
+
.codehilite .g { color: #c9d1d9 } /* Generic */
|
188 |
+
.codehilite .k { color: #ff7b72 } /* Keyword */
|
189 |
+
.codehilite .l { color: #a5d6ff } /* Literal */
|
190 |
+
.codehilite .n { color: #c9d1d9 } /* Name */
|
191 |
+
.codehilite .o { color: #ff7b72; font-weight: bold } /* Operator */
|
192 |
+
.codehilite .x { color: #c9d1d9 } /* Other */
|
193 |
+
.codehilite .p { color: #c9d1d9 } /* Punctuation */
|
194 |
+
.codehilite .ch { color: #8b949e; font-style: italic } /* Comment.Hashbang */
|
195 |
+
.codehilite .cm { color: #8b949e; font-style: italic } /* Comment.Multiline */
|
196 |
+
.codehilite .cp { color: #8b949e; font-weight: bold; font-style: italic } /* Comment.Preproc */
|
197 |
+
.codehilite .cpf { color: #8b949e; font-style: italic } /* Comment.PreprocFile */
|
198 |
+
.codehilite .c1 { color: #8b949e; font-style: italic } /* Comment.Single */
|
199 |
+
.codehilite .cs { color: #8b949e; font-weight: bold; font-style: italic } /* Comment.Special */
|
200 |
+
.codehilite .gd { color: #ffa198; background-color: #490202 } /* Generic.Deleted */
|
201 |
+
.codehilite .ge { color: #c9d1d9; font-style: italic } /* Generic.Emph */
|
202 |
+
.codehilite .gr { color: #ffa198 } /* Generic.Error */
|
203 |
+
.codehilite .gh { color: #79c0ff; font-weight: bold } /* Generic.Heading */
|
204 |
+
.codehilite .gi { color: #56d364; background-color: #0f5323 } /* Generic.Inserted */
|
205 |
+
.codehilite .go { color: #8b949e } /* Generic.Output */
|
206 |
+
.codehilite .gp { color: #8b949e } /* Generic.Prompt */
|
207 |
+
.codehilite .gs { color: #c9d1d9; font-weight: bold } /* Generic.Strong */
|
208 |
+
.codehilite .gu { color: #79c0ff } /* Generic.Subheading */
|
209 |
+
.codehilite .gt { color: #ff7b72 } /* Generic.Traceback */
|
210 |
+
.codehilite .g-Underline { color: #c9d1d9; text-decoration: underline } /* Generic.Underline */
|
211 |
+
.codehilite .kc { color: #79c0ff } /* Keyword.Constant */
|
212 |
+
.codehilite .kd { color: #ff7b72 } /* Keyword.Declaration */
|
213 |
+
.codehilite .kn { color: #ff7b72 } /* Keyword.Namespace */
|
214 |
+
.codehilite .kp { color: #79c0ff } /* Keyword.Pseudo */
|
215 |
+
.codehilite .kr { color: #ff7b72 } /* Keyword.Reserved */
|
216 |
+
.codehilite .kt { color: #ff7b72 } /* Keyword.Type */
|
217 |
+
.codehilite .ld { color: #79c0ff } /* Literal.Date */
|
218 |
+
.codehilite .m { color: #a5d6ff } /* Literal.Number */
|
219 |
+
.codehilite .s { color: #a5d6ff } /* Literal.String */
|
220 |
+
.codehilite .na { color: #c9d1d9 } /* Name.Attribute */
|
221 |
+
.codehilite .nb { color: #c9d1d9 } /* Name.Builtin */
|
222 |
+
.codehilite .nc { color: #f0883e; font-weight: bold } /* Name.Class */
|
223 |
+
.codehilite .no { color: #79c0ff; font-weight: bold } /* Name.Constant */
|
224 |
+
.codehilite .nd { color: #d2a8ff; font-weight: bold } /* Name.Decorator */
|
225 |
+
.codehilite .ni { color: #ffa657 } /* Name.Entity */
|
226 |
+
.codehilite .ne { color: #f0883e; font-weight: bold } /* Name.Exception */
|
227 |
+
.codehilite .nf { color: #d2a8ff; font-weight: bold } /* Name.Function */
|
228 |
+
.codehilite .nl { color: #79c0ff; font-weight: bold } /* Name.Label */
|
229 |
+
.codehilite .nn { color: #ff7b72 } /* Name.Namespace */
|
230 |
+
.codehilite .nx { color: #c9d1d9 } /* Name.Other */
|
231 |
+
.codehilite .py { color: #79c0ff } /* Name.Property */
|
232 |
+
.codehilite .nt { color: #7ee787 } /* Name.Tag */
|
233 |
+
.codehilite .nv { color: #79c0ff } /* Name.Variable */
|
234 |
+
.codehilite .ow { color: #ff7b72; font-weight: bold } /* Operator.Word */
|
235 |
+
.codehilite .pm { color: #c9d1d9 } /* Punctuation.Marker */
|
236 |
+
.codehilite .w { color: #6e7681 } /* Text.Whitespace */
|
237 |
+
.codehilite .mb { color: #a5d6ff } /* Literal.Number.Bin */
|
238 |
+
.codehilite .mf { color: #a5d6ff } /* Literal.Number.Float */
|
239 |
+
.codehilite .mh { color: #a5d6ff } /* Literal.Number.Hex */
|
240 |
+
.codehilite .mi { color: #a5d6ff } /* Literal.Number.Integer */
|
241 |
+
.codehilite .mo { color: #a5d6ff } /* Literal.Number.Oct */
|
242 |
+
.codehilite .sa { color: #79c0ff } /* Literal.String.Affix */
|
243 |
+
.codehilite .sb { color: #a5d6ff } /* Literal.String.Backtick */
|
244 |
+
.codehilite .sc { color: #a5d6ff } /* Literal.String.Char */
|
245 |
+
.codehilite .dl { color: #79c0ff } /* Literal.String.Delimiter */
|
246 |
+
.codehilite .sd { color: #a5d6ff } /* Literal.String.Doc */
|
247 |
+
.codehilite .s2 { color: #a5d6ff } /* Literal.String.Double */
|
248 |
+
.codehilite .se { color: #79c0ff } /* Literal.String.Escape */
|
249 |
+
.codehilite .sh { color: #79c0ff } /* Literal.String.Heredoc */
|
250 |
+
.codehilite .si { color: #a5d6ff } /* Literal.String.Interpol */
|
251 |
+
.codehilite .sx { color: #a5d6ff } /* Literal.String.Other */
|
252 |
+
.codehilite .sr { color: #79c0ff } /* Literal.String.Regex */
|
253 |
+
.codehilite .s1 { color: #a5d6ff } /* Literal.String.Single */
|
254 |
+
.codehilite .ss { color: #a5d6ff } /* Literal.String.Symbol */
|
255 |
+
.codehilite .bp { color: #c9d1d9 } /* Name.Builtin.Pseudo */
|
256 |
+
.codehilite .fm { color: #d2a8ff; font-weight: bold } /* Name.Function.Magic */
|
257 |
+
.codehilite .vc { color: #79c0ff } /* Name.Variable.Class */
|
258 |
+
.codehilite .vg { color: #79c0ff } /* Name.Variable.Global */
|
259 |
+
.codehilite .vi { color: #79c0ff } /* Name.Variable.Instance */
|
260 |
+
.codehilite .vm { color: #79c0ff } /* Name.Variable.Magic */
|
261 |
+
.codehilite .il { color: #a5d6ff } /* Literal.Number.Integer.Long */
|
262 |
+
|
263 |
+
.dark .codehilite .hll { background-color: #2C3B41 }
|
264 |
+
.dark .codehilite .c { color: #79d618; font-style: italic } /* Comment */
|
265 |
+
.dark .codehilite .err { color: #FF5370 } /* Error */
|
266 |
+
.dark .codehilite .esc { color: #89DDFF } /* Escape */
|
267 |
+
.dark .codehilite .g { color: #EEFFFF } /* Generic */
|
268 |
+
.dark .codehilite .k { color: #BB80B3 } /* Keyword */
|
269 |
+
.dark .codehilite .l { color: #C3E88D } /* Literal */
|
270 |
+
.dark .codehilite .n { color: #EEFFFF } /* Name */
|
271 |
+
.dark .codehilite .o { color: #89DDFF } /* Operator */
|
272 |
+
.dark .codehilite .p { color: #89DDFF } /* Punctuation */
|
273 |
+
.dark .codehilite .ch { color: #79d618; font-style: italic } /* Comment.Hashbang */
|
274 |
+
.dark .codehilite .cm { color: #79d618; font-style: italic } /* Comment.Multiline */
|
275 |
+
.dark .codehilite .cp { color: #79d618; font-style: italic } /* Comment.Preproc */
|
276 |
+
.dark .codehilite .cpf { color: #79d618; font-style: italic } /* Comment.PreprocFile */
|
277 |
+
.dark .codehilite .c1 { color: #79d618; font-style: italic } /* Comment.Single */
|
278 |
+
.dark .codehilite .cs { color: #79d618; font-style: italic } /* Comment.Special */
|
279 |
+
.dark .codehilite .gd { color: #FF5370 } /* Generic.Deleted */
|
280 |
+
.dark .codehilite .ge { color: #89DDFF } /* Generic.Emph */
|
281 |
+
.dark .codehilite .gr { color: #FF5370 } /* Generic.Error */
|
282 |
+
.dark .codehilite .gh { color: #C3E88D } /* Generic.Heading */
|
283 |
+
.dark .codehilite .gi { color: #C3E88D } /* Generic.Inserted */
|
284 |
+
.dark .codehilite .go { color: #79d618 } /* Generic.Output */
|
285 |
+
.dark .codehilite .gp { color: #FFCB6B } /* Generic.Prompt */
|
286 |
+
.dark .codehilite .gs { color: #FF5370 } /* Generic.Strong */
|
287 |
+
.dark .codehilite .gu { color: #89DDFF } /* Generic.Subheading */
|
288 |
+
.dark .codehilite .gt { color: #FF5370 } /* Generic.Traceback */
|
289 |
+
.dark .codehilite .kc { color: #89DDFF } /* Keyword.Constant */
|
290 |
+
.dark .codehilite .kd { color: #BB80B3 } /* Keyword.Declaration */
|
291 |
+
.dark .codehilite .kn { color: #89DDFF; font-style: italic } /* Keyword.Namespace */
|
292 |
+
.dark .codehilite .kp { color: #89DDFF } /* Keyword.Pseudo */
|
293 |
+
.dark .codehilite .kr { color: #BB80B3 } /* Keyword.Reserved */
|
294 |
+
.dark .codehilite .kt { color: #BB80B3 } /* Keyword.Type */
|
295 |
+
.dark .codehilite .ld { color: #C3E88D } /* Literal.Date */
|
296 |
+
.dark .codehilite .m { color: #F78C6C } /* Literal.Number */
|
297 |
+
.dark .codehilite .s { color: #C3E88D } /* Literal.String */
|
298 |
+
.dark .codehilite .na { color: #BB80B3 } /* Name.Attribute */
|
299 |
+
.dark .codehilite .nb { color: #82AAFF } /* Name.Builtin */
|
300 |
+
.dark .codehilite .nc { color: #FFCB6B } /* Name.Class */
|
301 |
+
.dark .codehilite .no { color: #EEFFFF } /* Name.Constant */
|
302 |
+
.dark .codehilite .nd { color: #82AAFF } /* Name.Decorator */
|
303 |
+
.dark .codehilite .ni { color: #89DDFF } /* Name.Entity */
|
304 |
+
.dark .codehilite .ne { color: #FFCB6B } /* Name.Exception */
|
305 |
+
.dark .codehilite .nf { color: #82AAFF } /* Name.Function */
|
306 |
+
.dark .codehilite .nl { color: #82AAFF } /* Name.Label */
|
307 |
+
.dark .codehilite .nn { color: #FFCB6B } /* Name.Namespace */
|
308 |
+
.dark .codehilite .nx { color: #EEFFFF } /* Name.Other */
|
309 |
+
.dark .codehilite .py { color: #FFCB6B } /* Name.Property */
|
310 |
+
.dark .codehilite .nt { color: #FF5370 } /* Name.Tag */
|
311 |
+
.dark .codehilite .nv { color: #89DDFF } /* Name.Variable */
|
312 |
+
.dark .codehilite .ow { color: #89DDFF; font-style: italic } /* Operator.Word */
|
313 |
+
.dark .codehilite .pm { color: #89DDFF } /* Punctuation.Marker */
|
314 |
+
.dark .codehilite .w { color: #EEFFFF } /* Text.Whitespace */
|
315 |
+
.dark .codehilite .mb { color: #F78C6C } /* Literal.Number.Bin */
|
316 |
+
.dark .codehilite .mf { color: #F78C6C } /* Literal.Number.Float */
|
317 |
+
.dark .codehilite .mh { color: #F78C6C } /* Literal.Number.Hex */
|
318 |
+
.dark .codehilite .mi { color: #F78C6C } /* Literal.Number.Integer */
|
319 |
+
.dark .codehilite .mo { color: #F78C6C } /* Literal.Number.Oct */
|
320 |
+
.dark .codehilite .sa { color: #BB80B3 } /* Literal.String.Affix */
|
321 |
+
.dark .codehilite .sb { color: #C3E88D } /* Literal.String.Backtick */
|
322 |
+
.dark .codehilite .sc { color: #C3E88D } /* Literal.String.Char */
|
323 |
+
.dark .codehilite .dl { color: #EEFFFF } /* Literal.String.Delimiter */
|
324 |
+
.dark .codehilite .sd { color: #79d618; font-style: italic } /* Literal.String.Doc */
|
325 |
+
.dark .codehilite .s2 { color: #C3E88D } /* Literal.String.Double */
|
326 |
+
.dark .codehilite .se { color: #EEFFFF } /* Literal.String.Escape */
|
327 |
+
.dark .codehilite .sh { color: #C3E88D } /* Literal.String.Heredoc */
|
328 |
+
.dark .codehilite .si { color: #89DDFF } /* Literal.String.Interpol */
|
329 |
+
.dark .codehilite .sx { color: #C3E88D } /* Literal.String.Other */
|
330 |
+
.dark .codehilite .sr { color: #89DDFF } /* Literal.String.Regex */
|
331 |
+
.dark .codehilite .s1 { color: #C3E88D } /* Literal.String.Single */
|
332 |
+
.dark .codehilite .ss { color: #89DDFF } /* Literal.String.Symbol */
|
333 |
+
.dark .codehilite .bp { color: #89DDFF } /* Name.Builtin.Pseudo */
|
334 |
+
.dark .codehilite .fm { color: #82AAFF } /* Name.Function.Magic */
|
335 |
+
.dark .codehilite .vc { color: #89DDFF } /* Name.Variable.Class */
|
336 |
+
.dark .codehilite .vg { color: #89DDFF } /* Name.Variable.Global */
|
337 |
+
.dark .codehilite .vi { color: #89DDFF } /* Name.Variable.Instance */
|
338 |
+
.dark .codehilite .vm { color: #82AAFF } /* Name.Variable.Magic */
|
339 |
+
.dark .codehilite .il { color: #F78C6C } /* Literal.Number.Integer.Long */
|
340 |
+
|
341 |
"""
|