mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-18 18:33:42 +00:00
110 lines
1.9 KiB
Stylus
110 lines
1.9 KiB
Stylus
@import hexo-config('highlight.file');
|
|
$highlight-background = convert(hexo-config('highlight.background'));
|
|
$highlight-foreground = convert(hexo-config('highlight.foreground'));
|
|
$highlight-gutter = {
|
|
color: mix($highlight-background, $highlight-foreground, 10%),
|
|
bg-color: mix($highlight-background, $highlight-foreground, 90%)
|
|
};
|
|
|
|
@import 'copy-code' if (hexo-config('codeblock.copy_button.enable'));
|
|
|
|
// Placeholder: $code-block
|
|
$code-block {
|
|
background: $highlight-background;
|
|
color: $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: $highlight-gutter.bg-color;
|
|
color: $highlight-foreground;
|
|
display: flex;
|
|
font-size: $table-font-size;
|
|
justify-content: space-between;
|
|
line-height: 1.2;
|
|
padding: .5em;
|
|
|
|
a {
|
|
color: $highlight-foreground;
|
|
|
|
&:hover {
|
|
border-bottom-color: $highlight-foreground;
|
|
}
|
|
}
|
|
}
|
|
|
|
.gutter {
|
|
disable-user-select();
|
|
|
|
pre {
|
|
background: $highlight-gutter.bg-color;
|
|
color: $highlight-gutter.color;
|
|
padding-left: 10px;
|
|
padding-right: 10px;
|
|
text-align: right;
|
|
}
|
|
}
|
|
|
|
.code pre {
|
|
background: $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: $highlight-foreground;
|
|
font-size: $table-font-size;
|
|
padding: 0;
|
|
text-shadow: none;
|
|
}
|
|
}
|