Keldos commited on
Commit
de613b4
1 Parent(s): bfac445

代码块样式适配gradio3.30.0

Browse files
Files changed (2) hide show
  1. assets/custom.css +80 -72
  2. requirements.txt +1 -1
assets/custom.css CHANGED
@@ -405,7 +405,7 @@ thead th {
405
  padding: .5em .2em;
406
  }
407
  /* 行内代码 */
408
- code {
409
  display: inline;
410
  white-space: break-spaces;
411
  border-radius: 6px;
@@ -414,13 +414,13 @@ code {
414
  background-color: rgba(175,184,193,0.2);
415
  }
416
  /* 代码块 */
417
- pre code {
418
  display: block;
419
  overflow: auto;
420
  white-space: pre;
421
  background-color: hsla(0, 0%, 0%, 80%)!important;
422
  border-radius: 10px;
423
- padding: 1.4em 1.2em 0em 1.4em;
424
  margin: 0.6em 2em 1em 0.2em;
425
  color: #FFF;
426
  box-shadow: 6px 6px 16px hsla(0, 0%, 0%, 0.2);
@@ -428,73 +428,81 @@ pre code {
428
  .message pre {
429
  padding: 0 !important;
430
  }
 
 
 
 
 
 
 
 
431
  /* 代码高亮样式 */
432
- .highlight .hll { background-color: #49483e }
433
- .highlight .c { color: #75715e } /* Comment */
434
- .highlight .err { color: #960050; background-color: #1e0010 } /* Error */
435
- .highlight .k { color: #66d9ef } /* Keyword */
436
- .highlight .l { color: #ae81ff } /* Literal */
437
- .highlight .n { color: #f8f8f2 } /* Name */
438
- .highlight .o { color: #f92672 } /* Operator */
439
- .highlight .p { color: #f8f8f2 } /* Punctuation */
440
- .highlight .ch { color: #75715e } /* Comment.Hashbang */
441
- .highlight .cm { color: #75715e } /* Comment.Multiline */
442
- .highlight .cp { color: #75715e } /* Comment.Preproc */
443
- .highlight .cpf { color: #75715e } /* Comment.PreprocFile */
444
- .highlight .c1 { color: #75715e } /* Comment.Single */
445
- .highlight .cs { color: #75715e } /* Comment.Special */
446
- .highlight .gd { color: #f92672 } /* Generic.Deleted */
447
- .highlight .ge { font-style: italic } /* Generic.Emph */
448
- .highlight .gi { color: #a6e22e } /* Generic.Inserted */
449
- .highlight .gs { font-weight: bold } /* Generic.Strong */
450
- .highlight .gu { color: #75715e } /* Generic.Subheading */
451
- .highlight .kc { color: #66d9ef } /* Keyword.Constant */
452
- .highlight .kd { color: #66d9ef } /* Keyword.Declaration */
453
- .highlight .kn { color: #f92672 } /* Keyword.Namespace */
454
- .highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
455
- .highlight .kr { color: #66d9ef } /* Keyword.Reserved */
456
- .highlight .kt { color: #66d9ef } /* Keyword.Type */
457
- .highlight .ld { color: #e6db74 } /* Literal.Date */
458
- .highlight .m { color: #ae81ff } /* Literal.Number */
459
- .highlight .s { color: #e6db74 } /* Literal.String */
460
- .highlight .na { color: #a6e22e } /* Name.Attribute */
461
- .highlight .nb { color: #f8f8f2 } /* Name.Builtin */
462
- .highlight .nc { color: #a6e22e } /* Name.Class */
463
- .highlight .no { color: #66d9ef } /* Name.Constant */
464
- .highlight .nd { color: #a6e22e } /* Name.Decorator */
465
- .highlight .ni { color: #f8f8f2 } /* Name.Entity */
466
- .highlight .ne { color: #a6e22e } /* Name.Exception */
467
- .highlight .nf { color: #a6e22e } /* Name.Function */
468
- .highlight .nl { color: #f8f8f2 } /* Name.Label */
469
- .highlight .nn { color: #f8f8f2 } /* Name.Namespace */
470
- .highlight .nx { color: #a6e22e } /* Name.Other */
471
- .highlight .py { color: #f8f8f2 } /* Name.Property */
472
- .highlight .nt { color: #f92672 } /* Name.Tag */
473
- .highlight .nv { color: #f8f8f2 } /* Name.Variable */
474
- .highlight .ow { color: #f92672 } /* Operator.Word */
475
- .highlight .w { color: #f8f8f2 } /* Text.Whitespace */
476
- .highlight .mb { color: #ae81ff } /* Literal.Number.Bin */
477
- .highlight .mf { color: #ae81ff } /* Literal.Number.Float */
478
- .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */
479
- .highlight .mi { color: #ae81ff } /* Literal.Number.Integer */
480
- .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */
481
- .highlight .sa { color: #e6db74 } /* Literal.String.Affix */
482
- .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */
483
- .highlight .sc { color: #e6db74 } /* Literal.String.Char */
484
- .highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */
485
- .highlight .sd { color: #e6db74 } /* Literal.String.Doc */
486
- .highlight .s2 { color: #e6db74 } /* Literal.String.Double */
487
- .highlight .se { color: #ae81ff } /* Literal.String.Escape */
488
- .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */
489
- .highlight .si { color: #e6db74 } /* Literal.String.Interpol */
490
- .highlight .sx { color: #e6db74 } /* Literal.String.Other */
491
- .highlight .sr { color: #e6db74 } /* Literal.String.Regex */
492
- .highlight .s1 { color: #e6db74 } /* Literal.String.Single */
493
- .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */
494
- .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
495
- .highlight .fm { color: #a6e22e } /* Name.Function.Magic */
496
- .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */
497
- .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */
498
- .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */
499
- .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */
500
- .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */
 
405
  padding: .5em .2em;
406
  }
407
  /* 行内代码 */
408
+ .message :not(pre) code {
409
  display: inline;
410
  white-space: break-spaces;
411
  border-radius: 6px;
 
414
  background-color: rgba(175,184,193,0.2);
415
  }
416
  /* 代码块 */
417
+ .message pre code {
418
  display: block;
419
  overflow: auto;
420
  white-space: pre;
421
  background-color: hsla(0, 0%, 0%, 80%)!important;
422
  border-radius: 10px;
423
+ padding: 1.2em 1em 0em .5em;
424
  margin: 0.6em 2em 1em 0.2em;
425
  color: #FFF;
426
  box-shadow: 6px 6px 16px hsla(0, 0%, 0%, 0.2);
 
428
  .message pre {
429
  padding: 0 !important;
430
  }
431
+ .message pre code div.highlight {
432
+ background-color: unset !important;
433
+ }
434
+
435
+ button.copy-button {
436
+ display: none;
437
+ }
438
+
439
  /* 代码高亮样式 */
440
+ .highlight .hll { background-color: #49483e !important }
441
+ .highlight .c { color: #75715e !important } /* Comment */
442
+ .highlight .err { color: #960050 !important; background-color: #1e0010 } /* Error */
443
+ .highlight .k { color: #66d9ef !important} /* Keyword */
444
+ .highlight .l { color: #ae81ff !important} /* Literal */
445
+ .highlight .n { color: #f8f8f2 !important} /* Name */
446
+ .highlight .o { color: #f92672 !important} /* Operator */
447
+ .highlight .p { color: #f8f8f2 !important} /* Punctuation */
448
+ .highlight .ch { color: #75715e !important} /* Comment.Hashbang */
449
+ .highlight .cm { color: #75715e !important} /* Comment.Multiline */
450
+ .highlight .cp { color: #75715e !important} /* Comment.Preproc */
451
+ .highlight .cpf { color: #75715e !important} /* Comment.PreprocFile */
452
+ .highlight .c1 { color: #75715e !important} /* Comment.Single */
453
+ .highlight .cs { color: #75715e !important} /* Comment.Special */
454
+ .highlight .gd { color: #f92672 !important} /* Generic.Deleted */
455
+ .highlight .ge { font-style: italic !important} /* Generic.Emph */
456
+ .highlight .gi { color: #a6e22e !important} /* Generic.Inserted */
457
+ .highlight .gs { font-weight: bold !important} /* Generic.Strong */
458
+ .highlight .gu { color: #75715e !important} /* Generic.Subheading */
459
+ .highlight .kc { color: #66d9ef !important} /* Keyword.Constant */
460
+ .highlight .kd { color: #66d9ef !important} /* Keyword.Declaration */
461
+ .highlight .kn { color: #f92672 !important} /* Keyword.Namespace */
462
+ .highlight .kp { color: #66d9ef !important} /* Keyword.Pseudo */
463
+ .highlight .kr { color: #66d9ef !important} /* Keyword.Reserved */
464
+ .highlight .kt { color: #66d9ef !important} /* Keyword.Type */
465
+ .highlight .ld { color: #e6db74 !important} /* Literal.Date */
466
+ .highlight .m { color: #ae81ff !important} /* Literal.Number */
467
+ .highlight .s { color: #e6db74 !important} /* Literal.String */
468
+ .highlight .na { color: #a6e22e !important} /* Name.Attribute */
469
+ .highlight .nb { color: #f8f8f2 !important} /* Name.Builtin */
470
+ .highlight .nc { color: #a6e22e !important} /* Name.Class */
471
+ .highlight .no { color: #66d9ef !important} /* Name.Constant */
472
+ .highlight .nd { color: #a6e22e !important} /* Name.Decorator */
473
+ .highlight .ni { color: #f8f8f2 !important} /* Name.Entity */
474
+ .highlight .ne { color: #a6e22e !important} /* Name.Exception */
475
+ .highlight .nf { color: #a6e22e !important} /* Name.Function */
476
+ .highlight .nl { color: #f8f8f2 !important} /* Name.Label */
477
+ .highlight .nn { color: #f8f8f2 !important} /* Name.Namespace */
478
+ .highlight .nx { color: #a6e22e !important} /* Name.Other */
479
+ .highlight .py { color: #f8f8f2 !important} /* Name.Property */
480
+ .highlight .nt { color: #f92672 !important} /* Name.Tag */
481
+ .highlight .nv { color: #f8f8f2 !important} /* Name.Variable */
482
+ .highlight .ow { color: #f92672 !important} /* Operator.Word */
483
+ .highlight .w { color: #f8f8f2 !important} /* Text.Whitespace */
484
+ .highlight .mb { color: #ae81ff !important} /* Literal.Number.Bin */
485
+ .highlight .mf { color: #ae81ff !important} /* Literal.Number.Float */
486
+ .highlight .mh { color: #ae81ff !important} /* Literal.Number.Hex */
487
+ .highlight .mi { color: #ae81ff !important} /* Literal.Number.Integer */
488
+ .highlight .mo { color: #ae81ff !important} /* Literal.Number.Oct */
489
+ .highlight .sa { color: #e6db74 !important} /* Literal.String.Affix */
490
+ .highlight .sb { color: #e6db74 !important} /* Literal.String.Backtick */
491
+ .highlight .sc { color: #e6db74 !important} /* Literal.String.Char */
492
+ .highlight .dl { color: #e6db74 !important} /* Literal.String.Delimiter */
493
+ .highlight .sd { color: #e6db74 !important} /* Literal.String.Doc */
494
+ .highlight .s2 { color: #e6db74 !important} /* Literal.String.Double */
495
+ .highlight .se { color: #ae81ff !important} /* Literal.String.Escape */
496
+ .highlight .sh { color: #e6db74 !important} /* Literal.String.Heredoc */
497
+ .highlight .si { color: #e6db74 !important} /* Literal.String.Interpol */
498
+ .highlight .sx { color: #e6db74 !important} /* Literal.String.Other */
499
+ .highlight .sr { color: #e6db74 !important} /* Literal.String.Regex */
500
+ .highlight .s1 { color: #e6db74 !important} /* Literal.String.Single */
501
+ .highlight .ss { color: #e6db74 !important} /* Literal.String.Symbol */
502
+ .highlight .bp { color: #f8f8f2 !important} /* Name.Builtin.Pseudo */
503
+ .highlight .fm { color: #a6e22e !important} /* Name.Function.Magic */
504
+ .highlight .vc { color: #f8f8f2 !important} /* Name.Variable.Class */
505
+ .highlight .vg { color: #f8f8f2 !important} /* Name.Variable.Global */
506
+ .highlight .vi { color: #f8f8f2 !important} /* Name.Variable.Instance */
507
+ .highlight .vm { color: #f8f8f2 !important} /* Name.Variable.Magic */
508
+ .highlight .il { color: #ae81ff !important} /* Literal.Number.Integer.Long */
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
- gradio==3.28.0
2
  gradio_client==0.1.4
3
  mdtex2html
4
  pypinyin
 
1
+ gradio==3.30.0
2
  gradio_client==0.1.4
3
  mdtex2html
4
  pypinyin