hexo-theme-butterfly/source/css/_highlight/highlight.styl
Jerry 83dc0559c0 1. Feature: 可設置内联代码块样式 #26
2. Feature: 可設置夜間模式作爲默認樣式
3. Feature: 可設置是否顯示code language名稱
4. Feature: 可設置是否展開或關閉代碼框
5. Feature: 可設置背景圖片/顔色
6. Feature: 可設置是否顯示footer背景
7. Feature: 增加 canvas-nest.js
8. Feature: 頭像可設置效果(轉圈圈)
9. Feature: menu可設置分組
9. Fix: 優化打賞和搜索打開特效
10. Fix: 優化sidebar的打開特效,避免與文章頁特效不同步
11. Fix: 適配**hexo-blog-encrypt**,現在可以顯示toc
12. Fix: 修復設置不顯示評論時,直達評論按鈕沒有消失的bug
13. Fix: 修復post頁底欄,當沒有顯示評論,不顯示TOC,評論和toc都不顯示 這三種狀態下按鈕的bug
14. Fix: 修復代碼框左右滑動時,代碼名字跟著滑動的bug
15. Fix: 其他page頁標題的字體顯示
16. Fix: 修復當設置開啓canvas_ribbons,進入網站會先顯示canvas_ribbons的bug
17. Fix: 完善夜間模式下,字體顯示問題
18. Fix: 修復代碼框 複製 和 代碼名 z-index bug #25
19. Fix: 完善阅读模式
2019-09-08 16:17:07 +08:00

280 lines
5.4 KiB
Stylus

// https://github.com/equinusocio/vsc-material-theme
@require "theme"
@require "diff"
wordWrap = !hexo-config("rootConfig.highlight.line_number") && hexo-config("code_word_wrap")
$code-block
overflow: auto
margin: 1rem 0
padding: 0
padding-top: 1.4rem
background: $highlight-background
color: $highlight-foreground
font-size: $code-font-size
line-height: $line-height-code-block
if wordWrap
counter-reset: line
white-space: pre-wrap
figure.highlight
position: relative
blockquote
margin: 0
padding: 0.1rem 0.8rem
border-left: 0.2rem solid $blockquote-padding-color
color: $blockquote-color
background-color: lighten($blockquote-padding-color,33)
.article-container
pre,
code
font-family: $code-font !important
code
padding: 0.1rem 0.2rem
background: $code-background
color: $code-foreground
word-wrap: break-word
font-size: $code-font-size
pre
@extend $code-block
code
padding: 0
background: none
color: $highlight-foreground
text-shadow: none
.highlight
@extend $code-block
position: relative
border-radius: 1px
&:after
position: absolute
top: 0
z-index: 0
min-width: 100%
height: 1.4rem
background: darken($highlight-background, 5)
content: ""
pre
margin: 0
padding: 8px 0
border: none
.line
&::selection
background: $highlight-selection
color: $highlight-foreground
if wordWrap
&:before
display: inline-block
padding: 0 0.3rem 0 0
min-width: 1.6rem
color: $highlight-gutter.color
content: counter(line)
counter-increment: line
text-align: left
table
position: relative
margin: 0
width: auto
border: none
if hexo-config('highlight_shrink') == true
display: none
&:after
position: absolute
top: -1.4rem
z-index: 0
width: 100%
height: 1.4rem
background: darken($highlight-background, 5)
content: ""
td
padding: 0
border: none
figcaption
clearfix()
position: absolute
z-index: 1
margin-bottom: 1em
padding: 0.2em 0 0.2em 0.7rem
width: 100%
height: 1.4em
color: $highlight-foreground
font-size: 1em
line-height: 1em
span
float: left
overflow: hidden
max-width: 100%
text-overflow: ellipsis
white-space: nowrap
a
float: right
padding-right: 10px
color: $highlight-foreground
&:hover
border-bottom-color: $highlight-foreground
&+table
margin-top: 1em
&:before
margin-top: -2.1rem
&:after
top: -2.1rem
.gutter pre
padding-right: 0.5rem
padding-left: 0.5rem
background-color: $highlight-gutter.bg-color
color: $highlight-gutter.color
text-align: right
.code pre
padding-right: 0.5rem
padding-left: 0.5rem
width: 100%
background-color: $highlight-background
.line
height: 1rem
.gutter
user-select: none
-webkit-user-select: none
-moz-user-select: none
-ms-user-select: none
.gist table
width: auto
td
border: none
// For diff highlight
pre .deletion
background: $highlight-deletion
pre .addition
background: $highlight-addition
pre .meta
color: $highlight-purple
pre
.comment
color: $highlight-comment
&::selection
background: $highlight-selection
color: $highlight-foreground
.variable,
.attribute,
.regexp,
.ruby .constant,
.xml .tag .title,
.xml .pi,
.xml .doctype,
.html .doctype,
.css .id,
.tag .name,
.css .class,
.css .pseudo
color: $highlight-red
&::selection
background: $highlight-selection
color: $highlight-foreground
.tag
color: $highlight-aqua
&::selection
background: $highlight-selection
color: $highlight-foreground
.number,
.preprocessor,
.literal,
.params,
.constant,
.command
color: $highlight-orange
&::selection
background: $highlight-selection
color: $highlight-foreground
.built_in
color: $highlight-yellow
&::selection
background: $highlight-selection
color: $highlight-foreground
.ruby .class .title,
.css .rules .attribute,
.string,
.value,
.inheritance,
.header,
.ruby .symbol,
.xml .cdata,
.special,
.number,
.formula
color: $highlight-green
&::selection
background: $highlight-selection
color: $highlight-foreground
.keyword,
.title,
.css .hexcolor
color: $highlight-aqua
&::selection
background: $highlight-selection
color: $highlight-foreground
.function,
.python .decorator,
.python .title,
.ruby .function .title,
.ruby .title .keyword,
.perl .sub,
.javascript .title,
.coffeescript .title
color: $highlight-blue
&::selection
background: $highlight-selection
color: $highlight-foreground
.tag .attr,
.javascript .function
color: $highlight-purple
&::selection
background: $highlight-selection
color: $highlight-foreground