2022-05-21 17:47:26 +08:00
|
|
|
|
2022-06-21 14:55:07 +08:00
|
|
|
.highlight {
|
|
|
|
|
|
|
|
background: var(--highlight-background);
|
2022-08-07 11:48:05 +08:00
|
|
|
margin-bottom: 26px;
|
2025-01-20 09:28:56 +08:00
|
|
|
line-height: 1.25;
|
2022-06-21 14:55:07 +08:00
|
|
|
|
2025-01-22 22:07:49 +08:00
|
|
|
> .code-header {
|
|
|
|
color:#f8f8f2;
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
padding: .25rem 0;
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
|
|
|
.code-lang {
|
|
|
|
width: 100%;
|
|
|
|
text-align: center;
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
|
|
&::after {
|
|
|
|
content: "Code";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.collapse-btn {
|
|
|
|
font-family: "Font Awesome 6 Free";
|
|
|
|
font-weight: 900;
|
|
|
|
text-align: center;
|
|
|
|
width: 1.25em;
|
|
|
|
display: inline-block;
|
|
|
|
font-style: normal;
|
|
|
|
font-variant: normal;
|
|
|
|
line-height: 1;
|
|
|
|
text-rendering: auto;
|
|
|
|
padding-right: .25rem;
|
|
|
|
|
|
|
|
&::before {
|
|
|
|
content: "\f102";
|
|
|
|
}
|
|
|
|
|
|
|
|
&.collapse::before {
|
|
|
|
content: "\f103";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@each $type, $text in $code-type-list {
|
|
|
|
&.#{$type} .code-lang::after {
|
|
|
|
content: $text;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.ellipses-btn {
|
|
|
|
padding-right: .45rem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-01-21 20:44:34 +08:00
|
|
|
> .chroma {
|
2022-06-21 14:55:07 +08:00
|
|
|
position: relative;
|
2025-01-22 22:07:49 +08:00
|
|
|
|
|
|
|
&.hidden-code {
|
|
|
|
display: none;
|
|
|
|
}
|
2025-01-21 20:44:34 +08:00
|
|
|
|
|
|
|
pre {
|
|
|
|
padding: .45rem 0;
|
|
|
|
}
|
2022-06-21 14:55:07 +08:00
|
|
|
|
2025-01-21 20:44:34 +08:00
|
|
|
.lntd:first-child {
|
|
|
|
min-width: 1.6rem;
|
|
|
|
text-align: right;
|
|
|
|
background-color: #272822;
|
2022-08-08 12:56:01 +08:00
|
|
|
|
2025-01-21 20:44:34 +08:00
|
|
|
a {
|
|
|
|
border-bottom: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.lntd:last-child {
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
pre {
|
|
|
|
overflow-wrap: break-word;
|
|
|
|
white-space: pre-wrap;
|
|
|
|
line-break: anywhere;
|
|
|
|
word-break: break-all;
|
|
|
|
overflow-x: auto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> code > span {
|
|
|
|
overflow-wrap: break-word;
|
|
|
|
white-space: pre-wrap;
|
|
|
|
line-break: anywhere;
|
|
|
|
word-break: break-all;
|
|
|
|
}
|
|
|
|
|
2025-01-22 22:07:49 +08:00
|
|
|
@if $codeblock_copy_btn_enable {
|
2022-06-29 08:56:13 +08:00
|
|
|
|
2025-01-22 22:07:49 +08:00
|
|
|
&:hover .copy-btn {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.copy-btn {
|
|
|
|
color: $black-dim;
|
|
|
|
cursor: pointer;
|
|
|
|
line-height: 1.6;
|
|
|
|
opacity: 0;
|
|
|
|
padding: 2px 6px;
|
|
|
|
position: absolute;
|
|
|
|
right: 8px;
|
|
|
|
top: 4px;
|
|
|
|
border-radius: 3px;
|
|
|
|
font-size: $font-size-medium;
|
|
|
|
transition: opacity $transition-ease;
|
|
|
|
background: var(--highlight-background);
|
|
|
|
|
|
|
|
font-family: "Font Awesome 6 Free";
|
|
|
|
font-weight: 900;
|
|
|
|
text-align: center;
|
|
|
|
width: 1.25em;
|
|
|
|
display: inline-block;
|
|
|
|
font-style: normal;
|
|
|
|
font-variant: normal;
|
|
|
|
text-rendering: auto;
|
|
|
|
|
|
|
|
&::before {
|
|
|
|
content: "\f0c5";
|
|
|
|
}
|
|
|
|
|
|
|
|
&.copied::before {
|
|
|
|
content: "\f058";
|
|
|
|
}
|
|
|
|
|
|
|
|
&.uncopied::before {
|
|
|
|
content: "\f057";
|
|
|
|
}
|
|
|
|
|
|
|
|
@if $codeblock_style == 'flat' {
|
|
|
|
background: white;
|
|
|
|
border: 0;
|
|
|
|
} @else if $codeblock_style == 'mac' {
|
|
|
|
color: var(--highlight-foreground);
|
|
|
|
} @else {
|
|
|
|
background-color: $gainsboro;
|
|
|
|
background-image: linear-gradient(#fcfcfc, $gainsboro);
|
|
|
|
border: 1px solid #d5d5d5;
|
|
|
|
}
|
|
|
|
}
|
2022-06-29 08:56:13 +08:00
|
|
|
}
|
2022-05-21 17:47:26 +08:00
|
|
|
}
|
|
|
|
|
2025-01-22 22:07:49 +08:00
|
|
|
|
|
|
|
@if $codeblock_style == 'mac' {
|
|
|
|
|
2022-05-21 17:47:26 +08:00
|
|
|
border-radius: 5px;
|
|
|
|
box-shadow: 0 10px 30px 0 rgba(0, 0, 0, .4);
|
|
|
|
|
2025-01-22 22:07:49 +08:00
|
|
|
.code-header {
|
|
|
|
|
2025-01-21 20:44:34 +08:00
|
|
|
&::before {
|
|
|
|
background: #fc625d;
|
|
|
|
box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b;
|
|
|
|
margin-left: 10px;
|
|
|
|
@include round-icon(12px);
|
|
|
|
}
|
|
|
|
}
|
2022-05-21 17:47:26 +08:00
|
|
|
}
|
2025-01-22 22:07:49 +08:00
|
|
|
|
2022-06-29 08:56:13 +08:00
|
|
|
}
|