hexo-theme-keep/source/css/layout/common/highlight/highlight.styl

208 lines
3.0 KiB
Stylus
Raw Normal View History

2020-04-03 18:18:42 +08:00
@require "code-theme.styl"
$code-block {
overflow: auto;
margin: 20px 0;
padding: 0;
2020-04-03 23:52:46 +08:00
font-size 0.95em;
2020-04-03 18:18:42 +08:00
color: var(--highlight-foreground);
background: var(--highlight-background);
2020-04-03 23:52:46 +08:00
line-height: 1.5em;
2020-04-03 18:18:42 +08:00
transition: all 0.5s ease;
2020-04-03 23:52:46 +08:00
//&::-webkit-scrollbar {
// height: 8px;
//}
//
//&::-webkit-scrollbar-thumb {
// border-radius: 5px;
// background: rgba(0, 0, 0, 0.2)
//}
//
//&::-webkit-scrollbar-track {
// background: transparent;
//}
2020-04-03 18:18:42 +08:00
}
2020-04-03 18:18:42 +08:00
pre, code {
font-family: "Source Code Pro", consolas, Menlo;
}
code {
2020-04-03 18:18:42 +08:00
padding: 5px;
word-wrap: break-word;
2020-04-03 18:18:42 +08:00
color: var(--code-foreground);
background: var(--code-background);
border-radius: 2px;
font-size: $code-font-size;
}
pre {
@extend $code-block;
padding: 10px;
code {
padding: 0;
2020-04-03 18:18:42 +08:00
color: var(--highlight-foreground);
background: none;
text-shadow: none;
}
}
.highlight {
@extend $code-block;
2020-04-03 18:18:42 +08:00
border-radius: 1px;
pre {
border: none;
margin: 0;
padding: 10px 0;
}
table {
margin: 0;
width: auto;
border: none;
border-spacing: unset;
}
td {
border: none;
padding: 0;
}
figcaption {
font-size: 1em;
2020-04-03 18:18:42 +08:00
color: var(--highlight-foreground);
line-height: 1em;
margin-bottom: 1em;
a {
float: right;
2020-04-03 18:18:42 +08:00
color: var(--highlight-foreground);
2020-04-03 18:18:42 +08:00
&:hover {
border-bottom-color: var(--highlight-foreground);
}
}
}
.gutter pre {
2020-04-03 18:18:42 +08:00
padding-left: 10px;
padding-right: 10px;
color: var(--highlight-gutter-color);
text-align: center;
background-color: var(--highlight-gutter-bg-color);
}
.code pre {
width: 100%
padding-left: 10px
padding-right: 10px
2020-04-03 18:18:42 +08:00
background-color: var(--highlight-background)
}
2020-04-03 18:18:42 +08:00
.line {
height: 20px;
}
}
.gutter {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.gist table {
width: auto;
2020-04-03 18:18:42 +08:00
td {
border: none;
}
}
// For diff highlight
2020-04-03 18:18:42 +08:00
pre .deletion {
background: var(--highlight-deletion);
}
pre .addition {
background: var(--highlight-addition);
}
pre .meta {
color: var(--highlight-purple);
}
pre {
2020-04-03 18:18:42 +08:00
.comment {
color: var(--highlight-comment);
}
.variable
.attribute
.tag
.regexp
.ruby .constant
.xml .tag .title
.xml .pi
.xml .doctype
.html .doctype
.css .id
.css .class
.css .pseudo {
2020-04-03 18:18:42 +08:00
color: var(--highlight-red);
}
.number
.preprocessor
.built_in
.literal
.params
.constant
.command {
2020-04-03 18:18:42 +08:00
color: var(--highlight-orange);
}
.ruby .class .title
.css .rules .attribute
.string
.value
.inheritance
.header
.ruby .symbol
.xml .cdata
.special
.number
.formula {
2020-04-03 18:18:42 +08:00
color: highlight-green;
}
.title
.css .hexcolor {
2020-04-03 18:18:42 +08:00
color: var(--highlight-aqua);
}
.function
.python .decorator
.python .title
.ruby .function .title
.ruby .title .keyword
.perl .sub
.javascript .title
.coffeescript .title {
2020-04-03 18:18:42 +08:00
color: var(--highlight-blue);
}
.keyword
.javascript .function {
2020-04-03 18:18:42 +08:00
color: var(--highlight-purple);
}
}