2025-2-26-fixed
This commit is contained in:
@ -0,0 +1,67 @@
|
||||
.highlight-container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.highlight-container:hover .copy-btn, .highlight-container .copy-btn:focus {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.copy-btn {
|
||||
color: $black-dim;
|
||||
cursor: pointer;
|
||||
line-height: 1.6;
|
||||
opacity: 0;
|
||||
padding: 2px 6px;
|
||||
position: absolute;
|
||||
the-transition();
|
||||
|
||||
if (hexo-config('codeblock.copy_button.style') == 'flat') {
|
||||
background: white;
|
||||
border: 0;
|
||||
font-size: $font-size-smaller;
|
||||
right: 0;
|
||||
top: 0;
|
||||
} else if (hexo-config('codeblock.copy_button.style') == 'mac') {
|
||||
color: white;
|
||||
font-size: 14px;
|
||||
right: 0;
|
||||
top: 2px;
|
||||
} else {
|
||||
background-color: $gainsboro;
|
||||
background-image: linear-gradient(#fcfcfc, $gainsboro);
|
||||
border: 1px solid #d5d5d5;
|
||||
border-radius: 3px;
|
||||
font-size: $font-size-smaller;
|
||||
right: 4px;
|
||||
top: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
if (hexo-config('codeblock.copy_button.style') == 'mac') {
|
||||
.highlight-container {
|
||||
background: #21252b;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 10px 30px 0 rgba(0, 0, 0, .4);
|
||||
padding-top: 30px;
|
||||
|
||||
&::before {
|
||||
background: #fc625d;
|
||||
border-radius: 50%;
|
||||
box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b;
|
||||
content: ' ';
|
||||
height: 12px;
|
||||
left: 12px;
|
||||
margin-top: -20px;
|
||||
position: absolute;
|
||||
width: 12px;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
border-radius: 0 0 5px 5px;
|
||||
|
||||
.table-container {
|
||||
border-radius: 0 0 5px 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
if ($highlight-theme == 'normal') {
|
||||
$highlight-deletion = #fdd;
|
||||
$highlight-addition = #dfd;
|
||||
} else {
|
||||
$highlight-deletion = #800000;
|
||||
$highlight-addition = #008000;
|
||||
}
|
||||
@ -0,0 +1,151 @@
|
||||
// https://github.com/chriskempson/tomorrow-theme
|
||||
$highlight-theme = hexo-config('codeblock.highlight_theme');
|
||||
|
||||
@import 'theme';
|
||||
@import 'diff';
|
||||
|
||||
@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;
|
||||
|
||||
*::selection {
|
||||
background: $highlight-selection;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
// For diff highlight
|
||||
.deletion {
|
||||
background: $highlight-deletion;
|
||||
}
|
||||
|
||||
.addition {
|
||||
background: $highlight-addition;
|
||||
}
|
||||
|
||||
.meta {
|
||||
color: $highlight-yellow;
|
||||
disable-user-select();
|
||||
}
|
||||
|
||||
.comment {
|
||||
color: $highlight-comment;
|
||||
}
|
||||
|
||||
.variable, .attribute, .tag, .name, .regexp, .ruby .constant, .xml .tag .title, .xml .pi, .xml .doctype, .html .doctype, .css .id, .css .class, .css .pseudo {
|
||||
color: $highlight-red;
|
||||
}
|
||||
|
||||
.number, .preprocessor, .built_in, .builtin-name, .literal, .params, .constant, .command {
|
||||
color: $highlight-orange;
|
||||
}
|
||||
|
||||
.ruby .class .title, .css .rules .attribute, .string, .symbol, .value, .inheritance, .header, .ruby .symbol, .xml .cdata, .special, .formula {
|
||||
color: $highlight-green;
|
||||
}
|
||||
|
||||
.title, .css .hexcolor {
|
||||
color: $highlight-aqua;
|
||||
}
|
||||
|
||||
.function, .python .decorator, .python .title, .ruby .function .title, .ruby .title .keyword, .perl .sub, .javascript .title, .coffeescript .title {
|
||||
color: $highlight-blue;
|
||||
}
|
||||
|
||||
.keyword, .javascript .function {
|
||||
color: $highlight-purple;
|
||||
}
|
||||
}
|
||||
137
themes/next/source/css/_common/scaffolding/highlight/theme.styl
Normal file
137
themes/next/source/css/_common/scaffolding/highlight/theme.styl
Normal file
@ -0,0 +1,137 @@
|
||||
if ($highlight-theme == 'night') {
|
||||
$highlight-background = #1d1f21;
|
||||
$highlight-current-line = #282a2e;
|
||||
$highlight-selection = #373b41;
|
||||
$highlight-foreground = #c5c8c6;
|
||||
$highlight-comment = #969896;
|
||||
$highlight-red = #cc6666;
|
||||
$highlight-orange = #de935f;
|
||||
$highlight-yellow = #f0c674;
|
||||
$highlight-green = #b5bd68;
|
||||
$highlight-aqua = #8abeb7;
|
||||
$highlight-blue = #81a2be;
|
||||
$highlight-purple = #b294bb;
|
||||
$highlight-gutter = {
|
||||
color: lighten($highlight-background, 50%),
|
||||
bg-color: darken($highlight-background, 100%)
|
||||
};
|
||||
} else if ($highlight-theme == 'night eighties') {
|
||||
$highlight-background = #2d2d2d;
|
||||
$highlight-current-line = #393939;
|
||||
$highlight-selection = #515151;
|
||||
$highlight-foreground = #cccccc;
|
||||
$highlight-comment = #999999;
|
||||
$highlight-red = #f2777a;
|
||||
$highlight-orange = #f99157;
|
||||
$highlight-yellow = #ffcc66;
|
||||
$highlight-green = #99cc99;
|
||||
$highlight-aqua = #66cccc;
|
||||
$highlight-blue = #6699cc;
|
||||
$highlight-purple = #cc99cc;
|
||||
$highlight-gutter = {
|
||||
color: $highlight-comment,
|
||||
bg-color: darken($highlight-background, 40%)
|
||||
};
|
||||
} else if ($highlight-theme == 'night blue') {
|
||||
$highlight-background = #002451;
|
||||
$highlight-current-line = #00346e;
|
||||
$highlight-selection = #003f8e;
|
||||
$highlight-foreground = #ffffff;
|
||||
$highlight-comment = #7285b7;
|
||||
$highlight-red = #ff9da4;
|
||||
$highlight-orange = #ffc58f;
|
||||
$highlight-yellow = #ffeead;
|
||||
$highlight-green = #d1f1a9;
|
||||
$highlight-aqua = #99ffff;
|
||||
$highlight-blue = #bbdaff;
|
||||
$highlight-purple = #ebbbff;
|
||||
$highlight-gutter = {
|
||||
color: $highlight-comment,
|
||||
bg-color: darken($highlight-background, 60%)
|
||||
};
|
||||
} else if ($highlight-theme == 'night bright') {
|
||||
$highlight-background = #000000;
|
||||
$highlight-current-line = #2a2a2a;
|
||||
$highlight-selection = #424242;
|
||||
$highlight-foreground = #eaeaea;
|
||||
$highlight-comment = #969896;
|
||||
$highlight-red = #d54e53;
|
||||
$highlight-orange = #e78c45;
|
||||
$highlight-yellow = #e7c547;
|
||||
$highlight-green = #b9ca4a;
|
||||
$highlight-aqua = #70c0b1;
|
||||
$highlight-blue = #7aa6da;
|
||||
$highlight-purple = #c397d8;
|
||||
$highlight-gutter = {
|
||||
color: lighten($highlight-background, 40%),
|
||||
bg-color: lighten($highlight-background, 16%)
|
||||
};
|
||||
} else if ($highlight-theme == 'solarized') {
|
||||
$highlight-background = #fdf6e3;
|
||||
$highlight-current-line = #eee8d5;
|
||||
$highlight-selection = #eee8d5;
|
||||
$highlight-foreground = #586e75;
|
||||
$highlight-comment = #93a1a1;
|
||||
$highlight-red = #dc322f;
|
||||
$highlight-orange = #cb4b16;
|
||||
$highlight-yellow = #b58900;
|
||||
$highlight-green = #859900;
|
||||
$highlight-aqua = #2aa198;
|
||||
$highlight-blue = #268bd2;
|
||||
$highlight-purple = #6c71c4;
|
||||
$highlight-gutter = {
|
||||
color: $highlight-comment,
|
||||
bg-color: $highlight-background
|
||||
};
|
||||
} else if ($highlight-theme == 'solarized dark') {
|
||||
$highlight-background = #002b36;
|
||||
$highlight-current-line = #073642;
|
||||
$highlight-selection = #073642;
|
||||
$highlight-foreground = #93a1a1;
|
||||
$highlight-comment = #586e75;
|
||||
$highlight-red = #dc322f;
|
||||
$highlight-orange = #cb4b16;
|
||||
$highlight-yellow = #b58900;
|
||||
$highlight-green = #859900;
|
||||
$highlight-aqua = #2aa198;
|
||||
$highlight-blue = #268bd2;
|
||||
$highlight-purple = #6c71c4;
|
||||
$highlight-gutter = {
|
||||
color: $highlight-comment,
|
||||
bg-color: $highlight-background
|
||||
};
|
||||
} else if ($highlight-theme == 'galactic') {
|
||||
$highlight-background = #262626;
|
||||
$highlight-current-line = #303030;
|
||||
$highlight-selection = #303030;
|
||||
$highlight-foreground = #9e9e9e;
|
||||
$highlight-comment = #6a6a6a;
|
||||
$highlight-red = #ff511a;
|
||||
$highlight-orange = #dd7202;
|
||||
$highlight-yellow = #a68f01;
|
||||
$highlight-green = #4ca340;
|
||||
$highlight-aqua = #07a38f;
|
||||
$highlight-blue = #3294ff;
|
||||
$highlight-purple = #cc62fe;
|
||||
$highlight-gutter = {
|
||||
color: $highlight-comment,
|
||||
bg-color: $highlight-background
|
||||
};
|
||||
} else {
|
||||
$highlight-background = #f7f7f7;
|
||||
$highlight-current-line = #efefef;
|
||||
$highlight-selection = #d6d6d6;
|
||||
$highlight-foreground = #4d4d4c;
|
||||
$highlight-comment = #8e908c;
|
||||
$highlight-red = #c82829;
|
||||
$highlight-orange = #f5871f;
|
||||
$highlight-yellow = #eab700;
|
||||
$highlight-green = #718c00;
|
||||
$highlight-aqua = #3e999f;
|
||||
$highlight-blue = #4271ae;
|
||||
$highlight-purple = #8959a8;
|
||||
$highlight-gutter = {
|
||||
color: #869194,
|
||||
bg-color: #eff2f3
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user