mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-17 18:22:33 +00:00
114 lines
1.8 KiB
Stylus
114 lines
1.8 KiB
Stylus
@import hexo-config('highlight.light.file');
|
|
|
|
if (hexo-config('darkmode')) {
|
|
@media (prefers-color-scheme: dark) {
|
|
@import hexo-config('highlight.dark.file');
|
|
}
|
|
}
|
|
|
|
@import 'copy-code' if (hexo-config('codeblock.copy_button.enable'));
|
|
|
|
// Placeholder: $code-block
|
|
$code-block {
|
|
background: var(--highlight-background);
|
|
color: var(--highlight-foreground);
|
|
line-height: $line-height-code-block;
|
|
margin: 0 auto 20px;
|
|
}
|
|
|
|
pre, code {
|
|
font-family: $code-font-family;
|
|
}
|
|
|
|
code {
|
|
background: $code-background;
|
|
border-radius: 3px;
|
|
color: $code-foreground;
|
|
padding: 2px 4px;
|
|
word-wrap();
|
|
}
|
|
|
|
.highlight {
|
|
@extend $code-block;
|
|
position: relative;
|
|
|
|
pre {
|
|
border: 0;
|
|
margin: 0;
|
|
padding: 10px 0;
|
|
}
|
|
|
|
table {
|
|
border: 0;
|
|
margin: 0;
|
|
width: auto;
|
|
}
|
|
|
|
td {
|
|
border: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
figcaption {
|
|
background: var(--highlight-gutter-background);
|
|
color: var(--highlight-foreground);
|
|
display: flex;
|
|
font-size: $table-font-size;
|
|
justify-content: space-between;
|
|
line-height: 1.2;
|
|
padding: .5em;
|
|
|
|
a {
|
|
color: var(--highlight-foreground);
|
|
|
|
&:hover {
|
|
border-bottom-color: var(--highlight-foreground);
|
|
}
|
|
}
|
|
|
|
a, span {
|
|
min-width: 0;
|
|
}
|
|
}
|
|
|
|
.gutter {
|
|
disable-user-select();
|
|
|
|
pre {
|
|
background: var(--highlight-gutter-background);
|
|
color: var(--highlight-gutter-foreground);
|
|
padding-left: 10px;
|
|
padding-right: 10px;
|
|
text-align: right;
|
|
}
|
|
}
|
|
|
|
.code pre {
|
|
background: var(--highlight-background);
|
|
padding-left: 10px;
|
|
width: 100%;
|
|
}
|
|
}
|
|
|
|
.gist table {
|
|
width: auto;
|
|
|
|
td {
|
|
border: 0;
|
|
}
|
|
}
|
|
|
|
pre {
|
|
@extend $code-block;
|
|
overflow: auto;
|
|
padding: 10px;
|
|
|
|
code {
|
|
background: none;
|
|
color: var(--highlight-foreground);
|
|
font-size: $table-font-size;
|
|
padding: 0;
|
|
text-shadow: none;
|
|
}
|
|
}
|