You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

115 lines
1.7 KiB

code {
color: $color-emphasize;
font-family: $code-font-family;
font-size: $code-font-size;
font-variant-ligatures: none;
white-space: pre-wrap;
word-wrap: break-word;
// keyword
.kw, .cf {
color: seagreen;
font-weight: bold;
}
.op {
color: orangered;
}
.ot {
color: slateblue;
}
.dt {
color: blue;
}
// function
.fu {
color: blueviolet;
}
.st {
color: lightseagreen;
}
// character
.ch {
color: yellowgreen;
}
.cn {
color: blueviolet;
}
.at {
color: darkblue;
}
.va {
color: cornflowerblue;
}
}
div.sourceCode {
&::not(div.sourceCode &) {
@include scrollable;
}
}
code.sourceCode {
display: block;
margin: 1rem 0;
padding: 0;
font-size: 0;
white-space: pre;
overflow: scroll;
border-top: $border-regular;
border-bottom: $border-thin;
.numberLines & {
padding-left: 0;
counter-reset: line-number;
}
> span {
display: block;
white-space: pre;
font-size: $code-font-size;
&:first-child {
padding-top: 0.3rem;
}
&:last-child {
padding-bottom: 0.3rem;
}
.numberLines & {
counter-increment: line-number;
&:hover {
background-color: $color-hover;
> a:first-child {
color: $color-hyperlink;
}
}
&:target {
background-color: $color-highlight;
}
> a:first-child {
&::before {
display: inline-block;
width: 2rem;
padding: 0 0.5rem 0 0;
margin: 0 0.5rem 0 0;
border-right: $border-thin;
text-align: right;
content: counter(line-number);
user-select: none;
}
}
}
}
}