mirror of
https://github.com/yv1ing/MollyBlog.git
synced 2025-09-16 14:53:45 +08:00
new: Replace code highlight color and optimize interface layout
This commit is contained in:
@@ -164,9 +164,8 @@ a:hover {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 30px;
|
||||
bottom: 50px;
|
||||
color: var(--secondary-color);
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
|
||||
140
templates/default/assets/css/lib/github-dark.css
Normal file
140
templates/default/assets/css/lib/github-dark.css
Normal file
@@ -0,0 +1,140 @@
|
||||
/* Background */
|
||||
.highlight-bg {
|
||||
color: #d1d5da;
|
||||
background-color: #24292e;
|
||||
}
|
||||
|
||||
/* PreWrapper */
|
||||
.highlight-chroma {
|
||||
color: #d1d5da;
|
||||
background-color: #24292e;
|
||||
}
|
||||
|
||||
/* Error */
|
||||
.highlight-chroma .highlight-err {
|
||||
color: #f85149;
|
||||
}
|
||||
|
||||
/* LineTableTD */
|
||||
.highlight-chroma .highlight-lntd {
|
||||
vertical-align: top;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/* LineTable */
|
||||
.highlight-chroma .highlight-lntable {
|
||||
border-spacing: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/* LineHighlight */
|
||||
.highlight-chroma .highlight-hl {
|
||||
background-color: #2d333b;
|
||||
}
|
||||
|
||||
/* LineNumbersTable */
|
||||
.highlight-chroma .highlight-lnt {
|
||||
white-space: pre;
|
||||
user-select: none;
|
||||
margin-right: 0.4em;
|
||||
padding: 0 0.4em 0 0.4em;
|
||||
color: #768390;
|
||||
}
|
||||
|
||||
/* LineNumbers */
|
||||
.highlight-chroma .highlight-ln {
|
||||
white-space: pre;
|
||||
user-select: none;
|
||||
margin-right: 0.4em;
|
||||
padding: 0 0.4em 0 0.4em;
|
||||
color: #768390;
|
||||
}
|
||||
|
||||
/* Line */
|
||||
.highlight-chroma .highlight-line {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* Keyword */
|
||||
.highlight-chroma .highlight-k,
|
||||
.highlight-chroma .highlight-kc,
|
||||
.highlight-chroma .highlight-kd,
|
||||
.highlight-chroma .highlight-kn,
|
||||
.highlight-chroma .highlight-kp,
|
||||
.highlight-chroma .highlight-kr,
|
||||
.highlight-chroma .highlight-kt {
|
||||
color: #f47067;
|
||||
}
|
||||
|
||||
/* NameBuiltin */
|
||||
.highlight-chroma .highlight-nb {
|
||||
color: #6fdd8b;
|
||||
}
|
||||
|
||||
/* NameBuiltinPseudo */
|
||||
.highlight-chroma .highlight-bp {
|
||||
color: #39c5cf;
|
||||
}
|
||||
|
||||
/* NameClass */
|
||||
.highlight-chroma .highlight-nc {
|
||||
color: #ffab70;
|
||||
}
|
||||
|
||||
/* NameFunction */
|
||||
.highlight-chroma .highlight-nf,
|
||||
.highlight-chroma .highlight-nv {
|
||||
color: #79c0ff;
|
||||
}
|
||||
|
||||
/* LiteralString */
|
||||
.highlight-chroma .highlight-s,
|
||||
.highlight-chroma .highlight-sa,
|
||||
.highlight-chroma .highlight-sb,
|
||||
.highlight-chroma .highlight-sc,
|
||||
.highlight-chroma .highlight-dl,
|
||||
.highlight-chroma .highlight-sd,
|
||||
.highlight-chroma .highlight-s2,
|
||||
.highlight-chroma .highlight-se,
|
||||
.highlight-chroma .highlight-sh,
|
||||
.highlight-chroma .highlight-sx,
|
||||
.highlight-chroma .highlight-sr,
|
||||
.highlight-chroma .highlight-s1,
|
||||
.highlight-chroma .highlight-ss {
|
||||
color: #a5d6ff;
|
||||
}
|
||||
|
||||
/* LiteralNumber */
|
||||
.highlight-chroma .highlight-m,
|
||||
.highlight-chroma .highlight-mb,
|
||||
.highlight-chroma .highlight-mf,
|
||||
.highlight-chroma .highlight-mh,
|
||||
.highlight-chroma .highlight-mi,
|
||||
.highlight-chroma .highlight-il,
|
||||
.highlight-chroma .highlight-mo {
|
||||
color: #eac55f;
|
||||
}
|
||||
|
||||
/* Comment */
|
||||
.highlight-chroma .highlight-c,
|
||||
.highlight-chroma .highlight-ch,
|
||||
.highlight-chroma .highlight-cm,
|
||||
.highlight-chroma .highlight-c1 {
|
||||
color: #768390;
|
||||
}
|
||||
|
||||
/* CommentSpecial */
|
||||
.highlight-chroma .highlight-cs {
|
||||
color: #768390;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* CommentPreproc */
|
||||
.highlight-chroma .highlight-cp,
|
||||
.highlight-chroma .highlight-cpf {
|
||||
color: #ffa657;
|
||||
}
|
||||
149
templates/default/assets/css/lib/github-light.css
Normal file
149
templates/default/assets/css/lib/github-light.css
Normal file
@@ -0,0 +1,149 @@
|
||||
/* Background */
|
||||
.highlight-bg {
|
||||
color: #1a1a1a;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
/* PreWrapper */
|
||||
.highlight-chroma {
|
||||
color: #1a1a1a;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
/* Error */
|
||||
.highlight-chroma .highlight-err {
|
||||
color: #e03131;
|
||||
}
|
||||
|
||||
/* LineTableTD */
|
||||
.highlight-chroma .highlight-lntd {
|
||||
vertical-align: top;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/* LineTable */
|
||||
.highlight-chroma .highlight-lntable {
|
||||
border-spacing: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/* LineHighlight */
|
||||
.highlight-chroma .highlight-hl {
|
||||
background-color: #f0f4f8;
|
||||
}
|
||||
|
||||
/* LineNumbersTable */
|
||||
.highlight-chroma .highlight-lnt {
|
||||
white-space: pre;
|
||||
user-select: none;
|
||||
margin-right: 0.4em;
|
||||
padding: 0 0.4em 0 0.4em;
|
||||
color: #4a5568;
|
||||
}
|
||||
|
||||
/* LineNumbers */
|
||||
.highlight-chroma .highlight-ln {
|
||||
white-space: pre;
|
||||
user-select: none;
|
||||
margin-right: 0.4em;
|
||||
padding: 0 0.4em 0 0.4em;
|
||||
color: #4a5568;
|
||||
}
|
||||
|
||||
/* Line */
|
||||
.highlight-chroma .highlight-line {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* Keyword */
|
||||
.highlight-chroma .highlight-k,
|
||||
.highlight-chroma .highlight-kc,
|
||||
.highlight-chroma .highlight-kd,
|
||||
.highlight-chroma .highlight-kn,
|
||||
.highlight-chroma .highlight-kp,
|
||||
.highlight-chroma .highlight-kr,
|
||||
.highlight-chroma .highlight-kt {
|
||||
color: #d73a49;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* NameBuiltin */
|
||||
.highlight-chroma .highlight-nb {
|
||||
color: #116ab8;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* NameBuiltinPseudo */
|
||||
.highlight-chroma .highlight-bp {
|
||||
color: #22863a;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* NameClass */
|
||||
.highlight-chroma .highlight-nc {
|
||||
color: #953abf;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* NameFunction */
|
||||
.highlight-chroma .highlight-nf,
|
||||
.highlight-chroma .highlight-nv {
|
||||
color: #005cc5;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* LiteralString */
|
||||
.highlight-chroma .highlight-s,
|
||||
.highlight-chroma .highlight-sa,
|
||||
.highlight-chroma .highlight-sb,
|
||||
.highlight-chroma .highlight-sc,
|
||||
.highlight-chroma .highlight-dl,
|
||||
.highlight-chroma .highlight-sd,
|
||||
.highlight-chroma .highlight-s2,
|
||||
.highlight-chroma .highlight-se,
|
||||
.highlight-chroma .highlight-sh,
|
||||
.highlight-chroma .highlight-sx,
|
||||
.highlight-chroma .highlight-sr,
|
||||
.highlight-chroma .highlight-s1,
|
||||
.highlight-chroma .highlight-ss {
|
||||
color: #e36209;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* LiteralNumber */
|
||||
.highlight-chroma .highlight-m,
|
||||
.highlight-chroma .highlight-mb,
|
||||
.highlight-chroma .highlight-mf,
|
||||
.highlight-chroma .highlight-mh,
|
||||
.highlight-chroma .highlight-mi,
|
||||
.highlight-chroma .highlight-il,
|
||||
.highlight-chroma .highlight-mo {
|
||||
color: #d73a49;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Comment */
|
||||
.highlight-chroma .highlight-c,
|
||||
.highlight-chroma .highlight-ch,
|
||||
.highlight-chroma .highlight-cm,
|
||||
.highlight-chroma .highlight-c1 {
|
||||
color: #6a737d;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* CommentSpecial */
|
||||
.highlight-chroma .highlight-cs {
|
||||
color: #005cc5;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* CommentPreproc */
|
||||
.highlight-chroma .highlight-cp,
|
||||
.highlight-chroma .highlight-cpf {
|
||||
color: #e36209;
|
||||
font-weight: bold;
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
/* Background */ .highlight-bg { color: #ffffff; background-color: #1f1f24 }
|
||||
/* PreWrapper */ .highlight-chroma { color: #ffffff; background-color: #1f1f24; }
|
||||
/* Error */ .highlight-chroma .highlight-err { color: #960050 }
|
||||
/* LineTableTD */ .highlight-chroma .highlight-lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
|
||||
/* LineTable */ .highlight-chroma .highlight-lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
|
||||
/* LineHighlight */ .highlight-chroma .highlight-hl { background-color: #353539 }
|
||||
/* LineNumbersTable */ .highlight-chroma .highlight-lnt { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
|
||||
/* LineNumbers */ .highlight-chroma .highlight-ln { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
|
||||
/* Line */ .highlight-chroma .highlight-line { display: flex; }
|
||||
/* Keyword */ .highlight-chroma .highlight-k { color: #fc5fa3 }
|
||||
/* KeywordConstant */ .highlight-chroma .highlight-kc { color: #fc5fa3 }
|
||||
/* KeywordDeclaration */ .highlight-chroma .highlight-kd { color: #fc5fa3 }
|
||||
/* KeywordNamespace */ .highlight-chroma .highlight-kn { color: #fc5fa3 }
|
||||
/* KeywordPseudo */ .highlight-chroma .highlight-kp { color: #fc5fa3 }
|
||||
/* KeywordReserved */ .highlight-chroma .highlight-kr { color: #fc5fa3 }
|
||||
/* KeywordType */ .highlight-chroma .highlight-kt { color: #fc5fa3 }
|
||||
/* NameBuiltin */ .highlight-chroma .highlight-nb { color: #d0a8ff }
|
||||
/* NameBuiltinPseudo */ .highlight-chroma .highlight-bp { color: #a167e6 }
|
||||
/* NameClass */ .highlight-chroma .highlight-nc { color: #5dd8ff }
|
||||
/* NameFunction */ .highlight-chroma .highlight-nf { color: #41a1c0 }
|
||||
/* NameVariable */ .highlight-chroma .highlight-nv { color: #41a1c0 }
|
||||
/* LiteralString */ .highlight-chroma .highlight-s { color: #fc6a5d }
|
||||
/* LiteralStringAffix */ .highlight-chroma .highlight-sa { color: #fc6a5d }
|
||||
/* LiteralStringBacktick */ .highlight-chroma .highlight-sb { color: #fc6a5d }
|
||||
/* LiteralStringChar */ .highlight-chroma .highlight-sc { color: #fc6a5d }
|
||||
/* LiteralStringDelimiter */ .highlight-chroma .highlight-dl { color: #fc6a5d }
|
||||
/* LiteralStringDoc */ .highlight-chroma .highlight-sd { color: #fc6a5d }
|
||||
/* LiteralStringDouble */ .highlight-chroma .highlight-s2 { color: #fc6a5d }
|
||||
/* LiteralStringEscape */ .highlight-chroma .highlight-se { color: #fc6a5d }
|
||||
/* LiteralStringHeredoc */ .highlight-chroma .highlight-sh { color: #fc6a5d }
|
||||
/* LiteralStringOther */ .highlight-chroma .highlight-sx { color: #fc6a5d }
|
||||
/* LiteralStringRegex */ .highlight-chroma .highlight-sr { color: #fc6a5d }
|
||||
/* LiteralStringSingle */ .highlight-chroma .highlight-s1 { color: #fc6a5d }
|
||||
/* LiteralStringSymbol */ .highlight-chroma .highlight-ss { color: #fc6a5d }
|
||||
/* LiteralNumber */ .highlight-chroma .highlight-m { color: #d0bf69 }
|
||||
/* LiteralNumberBin */ .highlight-chroma .highlight-mb { color: #d0bf69 }
|
||||
/* LiteralNumberFloat */ .highlight-chroma .highlight-mf { color: #d0bf69 }
|
||||
/* LiteralNumberHex */ .highlight-chroma .highlight-mh { color: #d0bf69 }
|
||||
/* LiteralNumberInteger */ .highlight-chroma .highlight-mi { color: #d0bf69 }
|
||||
/* LiteralNumberIntegerLong */ .highlight-chroma .highlight-il { color: #d0bf69 }
|
||||
/* LiteralNumberOct */ .highlight-chroma .highlight-mo { color: #d0bf69 }
|
||||
/* Comment */ .highlight-chroma .highlight-c { color: #6c7986 }
|
||||
/* CommentHashbang */ .highlight-chroma .highlight-ch { color: #6c7986 }
|
||||
/* CommentMultiline */ .highlight-chroma .highlight-cm { color: #6c7986 }
|
||||
/* CommentSingle */ .highlight-chroma .highlight-c1 { color: #6c7986 }
|
||||
/* CommentSpecial */ .highlight-chroma .highlight-cs { color: #6c7986; font-style: italic }
|
||||
/* CommentPreproc */ .highlight-chroma .highlight-cp { color: #fd8f3f }
|
||||
/* CommentPreprocFile */ .highlight-chroma .highlight-cpf { color: #fd8f3f }
|
||||
@@ -1,69 +0,0 @@
|
||||
/* Background */ .highlight-bg { background-color: #ffffff }
|
||||
/* PreWrapper */ .highlight-chroma { background-color: #ffffff; }
|
||||
/* Error */ .highlight-chroma .highlight-err { color: #000000 }
|
||||
/* LineTableTD */ .highlight-chroma .highlight-lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
|
||||
/* LineTable */ .highlight-chroma .highlight-lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
|
||||
/* LineHighlight */ .highlight-chroma .highlight-hl { background-color: #e5e5e5 }
|
||||
/* LineNumbersTable */ .highlight-chroma .highlight-lnt { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
|
||||
/* LineNumbers */ .highlight-chroma .highlight-ln { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
|
||||
/* Line */ .highlight-chroma .highlight-line { display: flex; }
|
||||
/* Keyword */ .highlight-chroma .highlight-k { color: #a90d91 }
|
||||
/* KeywordConstant */ .highlight-chroma .highlight-kc { color: #a90d91 }
|
||||
/* KeywordDeclaration */ .highlight-chroma .highlight-kd { color: #a90d91 }
|
||||
/* KeywordNamespace */ .highlight-chroma .highlight-kn { color: #a90d91 }
|
||||
/* KeywordPseudo */ .highlight-chroma .highlight-kp { color: #a90d91 }
|
||||
/* KeywordReserved */ .highlight-chroma .highlight-kr { color: #a90d91 }
|
||||
/* KeywordType */ .highlight-chroma .highlight-kt { color: #a90d91 }
|
||||
/* Name */ .highlight-chroma .highlight-n { color: #000000 }
|
||||
/* NameAttribute */ .highlight-chroma .highlight-na { color: #836c28 }
|
||||
/* NameBuiltin */ .highlight-chroma .highlight-nb { color: #a90d91 }
|
||||
/* NameBuiltinPseudo */ .highlight-chroma .highlight-bp { color: #5b269a }
|
||||
/* NameClass */ .highlight-chroma .highlight-nc { color: #3f6e75 }
|
||||
/* NameConstant */ .highlight-chroma .highlight-no { color: #000000 }
|
||||
/* NameDecorator */ .highlight-chroma .highlight-nd { color: #000000 }
|
||||
/* NameEntity */ .highlight-chroma .highlight-ni { color: #000000 }
|
||||
/* NameException */ .highlight-chroma .highlight-ne { color: #000000 }
|
||||
/* NameFunction */ .highlight-chroma .highlight-nf { color: #000000 }
|
||||
/* NameFunctionMagic */ .highlight-chroma .highlight-fm { color: #000000 }
|
||||
/* NameLabel */ .highlight-chroma .highlight-nl { color: #000000 }
|
||||
/* NameNamespace */ .highlight-chroma .highlight-nn { color: #000000 }
|
||||
/* NameOther */ .highlight-chroma .highlight-nx { color: #000000 }
|
||||
/* NameProperty */ .highlight-chroma .highlight-py { color: #000000 }
|
||||
/* NameTag */ .highlight-chroma .highlight-nt { color: #000000 }
|
||||
/* NameVariable */ .highlight-chroma .highlight-nv { color: #000000 }
|
||||
/* NameVariableClass */ .highlight-chroma .highlight-vc { color: #000000 }
|
||||
/* NameVariableGlobal */ .highlight-chroma .highlight-vg { color: #000000 }
|
||||
/* NameVariableInstance */ .highlight-chroma .highlight-vi { color: #000000 }
|
||||
/* NameVariableMagic */ .highlight-chroma .highlight-vm { color: #000000 }
|
||||
/* Literal */ .highlight-chroma .highlight-l { color: #1c01ce }
|
||||
/* LiteralDate */ .highlight-chroma .highlight-ld { color: #1c01ce }
|
||||
/* LiteralString */ .highlight-chroma .highlight-s { color: #c41a16 }
|
||||
/* LiteralStringAffix */ .highlight-chroma .highlight-sa { color: #c41a16 }
|
||||
/* LiteralStringBacktick */ .highlight-chroma .highlight-sb { color: #c41a16 }
|
||||
/* LiteralStringChar */ .highlight-chroma .highlight-sc { color: #2300ce }
|
||||
/* LiteralStringDelimiter */ .highlight-chroma .highlight-dl { color: #c41a16 }
|
||||
/* LiteralStringDoc */ .highlight-chroma .highlight-sd { color: #c41a16 }
|
||||
/* LiteralStringDouble */ .highlight-chroma .highlight-s2 { color: #c41a16 }
|
||||
/* LiteralStringEscape */ .highlight-chroma .highlight-se { color: #c41a16 }
|
||||
/* LiteralStringHeredoc */ .highlight-chroma .highlight-sh { color: #c41a16 }
|
||||
/* LiteralStringInterpol */ .highlight-chroma .highlight-si { color: #c41a16 }
|
||||
/* LiteralStringOther */ .highlight-chroma .highlight-sx { color: #c41a16 }
|
||||
/* LiteralStringRegex */ .highlight-chroma .highlight-sr { color: #c41a16 }
|
||||
/* LiteralStringSingle */ .highlight-chroma .highlight-s1 { color: #c41a16 }
|
||||
/* LiteralStringSymbol */ .highlight-chroma .highlight-ss { color: #c41a16 }
|
||||
/* LiteralNumber */ .highlight-chroma .highlight-m { color: #1c01ce }
|
||||
/* LiteralNumberBin */ .highlight-chroma .highlight-mb { color: #1c01ce }
|
||||
/* LiteralNumberFloat */ .highlight-chroma .highlight-mf { color: #1c01ce }
|
||||
/* LiteralNumberHex */ .highlight-chroma .highlight-mh { color: #1c01ce }
|
||||
/* LiteralNumberInteger */ .highlight-chroma .highlight-mi { color: #1c01ce }
|
||||
/* LiteralNumberIntegerLong */ .highlight-chroma .highlight-il { color: #1c01ce }
|
||||
/* LiteralNumberOct */ .highlight-chroma .highlight-mo { color: #1c01ce }
|
||||
/* Operator */ .highlight-chroma .highlight-o { color: #000000 }
|
||||
/* OperatorWord */ .highlight-chroma .highlight-ow { color: #000000 }
|
||||
/* Comment */ .highlight-chroma .highlight-c { color: #177500 }
|
||||
/* CommentHashbang */ .highlight-chroma .highlight-ch { color: #177500 }
|
||||
/* CommentMultiline */ .highlight-chroma .highlight-cm { color: #177500 }
|
||||
/* CommentSingle */ .highlight-chroma .highlight-c1 { color: #177500 }
|
||||
/* CommentSpecial */ .highlight-chroma .highlight-cs { color: #177500 }
|
||||
/* CommentPreproc */ .highlight-chroma .highlight-cp { color: #633820 }
|
||||
/* CommentPreprocFile */ .highlight-chroma .highlight-cpf { color: #633820 }
|
||||
@@ -40,11 +40,11 @@ function setTheme() {
|
||||
function replaceCssFile() {
|
||||
let oldHref, newHref;
|
||||
if (theme === "dark") {
|
||||
oldHref = "xcode-light.css";
|
||||
newHref = "xcode-dark.css";
|
||||
oldHref = "github-light.css";
|
||||
newHref = "github-dark.css";
|
||||
} else {
|
||||
oldHref = "xcode-dark.css";
|
||||
newHref = "xcode-light.css";
|
||||
oldHref = "github-dark.css";
|
||||
newHref = "github-light.css";
|
||||
}
|
||||
|
||||
const links = document.querySelectorAll('link[rel="stylesheet"]');
|
||||
|
||||
Reference in New Issue
Block a user