@@ -487,12 +487,14 @@ p.no-javascript-notice {
487487}
488488
489489.code , .be-console , .unavailable {
490- background : #fff ;
491490 padding : 5px ;
492-
493491 box-shadow : inset 3px 3px 3px rgba (0 , 0 , 0 , 0.1 ), inset 0 0 0 1px rgba (0 , 0 , 0 , 0.1 );
494492}
495493
494+ .code , .unavailable {
495+ text-shadow : none ;
496+ }
497+
496498.code_linenums {
497499 background :#f1f1f1 ;
498500 padding-top :10px ;
@@ -505,16 +507,35 @@ p.no-javascript-notice {
505507 padding :0 12px ;
506508}
507509
510+ .code , .be-console .syntax-highlighted {
511+ text-shadow : none ;
512+
513+ @import " syntax_highlighting" ;
514+ }
515+ .code {
516+ // For now, the syntax-highlighted console only supports light mode.
517+ // Once the entire page has a dark theme, this should change.
518+ @media (prefers-color-scheme : dark ) {
519+ @import " syntax_highlighting_dark" ;
520+ }
521+ }
522+
508523.code {
509524 margin-bottom : -1px ;
510525 border-top-left-radius :2px ;
511526 padding : 10px 0 ;
512527 overflow : auto ;
513- }
514528
515- .code pre {
516- padding-left :12px ;
517- min-height :16px ;
529+ .code-wrapper {
530+ // This fixes the highlight or other background of the pre not stretching the full scrollable width.
531+ display : inline-block ;
532+ min-width : 100% ;
533+ }
534+
535+ pre {
536+ padding-left :12px ;
537+ min-height :16px ;
538+ }
518539}
519540
520541/* Source unavailable */
@@ -537,28 +558,32 @@ p.unavailable:before {
537558 margin-bottom : -10px ;
538559}
539560
561+ $code-highlight-background : rgba (51 , 136 , 170 , 0.15 );
562+ $code-highlight-background-flash : adjust-color ($code-highlight-background , $alpha : 0.3 );
563+
540564@-webkit-keyframes highlight {
541- 0% { background : rgba ( 220 , 30 , 30 , 0.3 ) ; }
542- 100% { background : rgba ( 220 , 30 , 30 , 0.1 ) ; }
565+ 0% { background : $code-highlight-background-flash ; }
566+ 100% { background : $code-highlight-background ; }
543567}
544568@-moz-keyframes highlight {
545- 0% { background : rgba ( 220 , 30 , 30 , 0.3 ) ; }
546- 100% { background : rgba ( 220 , 30 , 30 , 0.1 ) ; }
569+ 0% { background : $code-highlight-background-flash ; }
570+ 100% { background : $code-highlight-background ; }
547571}
548572@keyframes highlight {
549- 0% { background : rgba ( 220 , 30 , 30 , 0.3 ) ; }
550- 100% { background : rgba ( 220 , 30 , 30 , 0.1 ) ; }
573+ 0% { background : $code-highlight-background-flash ; }
574+ 100% { background : $code-highlight-background ; }
551575}
552576
553577.code .highlight , .code_linenums .highlight {
554- background : rgba ( 220 , 30 , 30 , 0.1 ) ;
578+ background : $code-highlight-background ;
555579 -webkit-animation : highlight 400ms linear 1 ;
556580 -moz-animation : highlight 400ms linear 1 ;
557581 animation : highlight 400ms linear 1 ;
558582}
559583
560584/* REPL shell */
561585.be-console {
586+ background : #fff ;
562587 padding : 0 1px 10px 1px ;
563588 border-bottom-left-radius : 2px ;
564589 border-bottom-right-radius : 2px ;
@@ -719,5 +744,3 @@ nav.sidebar:hover::-webkit-scrollbar-thumb {
719744.code :hover ::-webkit-scrollbar-thumb {
720745 background : #888 ;
721746}
722-
723- @import " syntax_highlighting" ;
0 commit comments