This commit is contained in:
loikein 2023-04-15 18:51:02 +01:00
parent a345157488
commit 6a57aac1e4
6 changed files with 141 additions and 144 deletions

View file

@ -1,63 +1,75 @@
$ht-code-border-radius: .4em;
.highlight {
width: 55%;
width: 50%;
overflow-x: scroll;
border-radius: $ht-code-border-radius;
// border-radius: $ht-code-border-radius;
margin-top: 1em;
margin-bottom: 1em;
margin-right: 2.5%;
margin-left: 2.5%;
-ms-overflow-style: none;
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
code {
font-size: 1rem;
display: block;
}
&>.chroma {
margin: 0;
}
&>.chroma .hl {
// border-radius: $ht-code-border-radius / 2;
display: block;
&::before{
content: "> ";
position: absolute;
left: 0;
color: #111;
}
}
&>div.chroma>table.lntable{
margin: $ht-code-border-radius 0 $ht-code-border-radius 0;
overflow: initial;
// margin: $ht-code-border-radius 0 $ht-code-border-radius 0;
& td:first-of-type {
& span:not(& span>span) {
padding: 0 .75em 0 .5em;
}
}
}
&>.chroma>code {
pre {
margin-block-start: 0.5em;
margin-block-end: 0.5em;
}
}
&>.chroma>code {
width: max-content;
margin-top: .5em;
margin-bottom: .5em;
margin-left: .5em;
&>span.hl{
margin-left: -.5em;
padding-left: .5em;
}
}
.chroma .hl {
// border-radius: $ht-code-border-radius / 2;
display: block;
}
&::-webkit-scrollbar {
border-radius: $ht-code-border-radius;
width: 10px;
height: 1rem;
}
&::-webkit-scrollbar-thumb {
border-radius: $ht-code-border-radius;
}
}
@media screen and (max-width: 760px) {
.highlight {
.highlight .chroma {
width: 90%;
}
}
.highlight .lntable {
overflow: initial;
}
.highlight pre {
margin: 0;
}
.highlight pre code {
display: block;
font-size: 1rem;
}
// fix #48 => https://github.com/slashformotion/hugo-tufte/issues/48
ul>li>div.highlight {
width: 100%;

View file

@ -1,12 +1,3 @@
$ht-code-bgcolor: #282a36;
@import "syntax-dark.scss";
.highlight {
&::-webkit-scrollbar {
background: $ht-code-bgcolor;
}
&::-webkit-scrollbar-thumb {
background: scale-color($ht-code-bgcolor, $lightness: 23%, $saturation: -40%);
}
}

View file

@ -1,12 +1,3 @@
$ht-code-bgcolor: #dde2ff;
@import "syntax-light.scss";
.highlight {
&::-webkit-scrollbar {
background: $ht-code-bgcolor;
}
&::-webkit-scrollbar-thumb {
background: scale-color($ht-code-bgcolor, $lightness: -13%, $saturation: -80%);
}
}

View file

@ -12,6 +12,7 @@
* @author Zeno Rocha <hi@zenorocha.com>
*/
.highlight .lnt { color: #6272a4 } /* line number */
.highlight .hl { background-color: scale-color($ht-code-bgcolor, $lightness: 32%, $saturation: -40%) }
.highlight { background: $ht-code-bgcolor; color: #f8f8f2 }
.highlight .c { color: #6272a4 } /* Comment */

View file

@ -1,5 +1,6 @@
.highlight .hl { background-color: #ffffd4 }
.highlight { background: $ht-code-bgcolor;}
// .highlight .hl { background-color: #ffffd4 }
// .highlight { background: $ht-code-bgcolor;}
.highlight .lnt { color: #6a737d } /* line number */
.highlight .c { color: #6a737d } /* Comment */
.highlight .err { } /* Error */
.highlight .k { color: #d73a49 } /* Keyword */

View file

@ -347,6 +347,7 @@ h3 .code {
}
pre.code {
font-size: 0.9rem;
width: 52.5%;
padding-left: 2.5%;
overflow-x: scroll;