hexo-theme-butterfly/source/css/_highlight/highlight.styl
Jerry c512a5fda5 1. chore: 只支持hexo 4.2.0以上版本
2. feat: 可隱藏Mobile sidebar 子菜單
3. refactor: archives和card-post 改為flex佈局
4. feat: 當寬度小於1024時,點擊toc滾動,增加滾動效果
5. feat: 點擊滾動,如果滾動是向上時,將會偏移60px, 避免導航欄遮擋 close #317
6. feat: 可配置font-size
7. refactor: 去除字體放大、縮小按鈕
8. refactor: 部分css由'px'改為'em',適應font-size值改變而改變
9.  feat: pjax增加exclude配置
10. fix: 修復canvas_nest 配置沒有生效的Bugs
11. feat: 新增 cnzz_analytics
12. feat: 騰訊分析改為騰訊移動分析,並適配pjax
13. perf: 改cookies為localstore存儲
14. feat: 設置中的theme_color可單獨配置幾個,而不需要全部開啟 close #314
15. feat: butterfly.yml 採用deepMerge, 與_config文件進行合併而不是替換
16. fix: 修復rightsize-bottom配置無效的bug
17. refactor: aside增加position sticky
18. refactor: 調整webinfo 寬度小時的顯示
19. feat: 更改addtoany item的寫法
20. refactor: aside 內容邊距調整
21. feat: 增加最後更新時間顯示
2020-08-18 00:33:05 +08:00

215 lines
4.2 KiB
Stylus

// https://github.com/equinusocio/vsc-material-theme
$highlight_theme = hexo-config('highlight_theme')
@require 'theme'
if $highlight_theme != false
@require 'diff'
wordWrap = !hexo-config('rootConfig.highlight.line_number') && hexo-config('code_word_wrap')
$code-block
overflow: auto
margin: 0 0 1rem
padding: 0
background: $highlight-background
color: $highlight-foreground
line-height: $line-height-code-block
if wordWrap
counter-reset: line
white-space: pre-wrap
blockquote
margin: 0 0 1rem
padding: .1rem .8rem
border-left: .2rem solid $blockquote-padding-color
background-color: var(--blockquote-bg)
color: var(--blockquote-color)
a
word-break: break-all
p
margin: 0 !important
padding: .5rem 0
footer
padding: 0 0 .5rem
cite
&:before
padding: 0 .3em
content: ''
#article-container
pre,
code
font-family: $code-font !important
code
padding: .1rem .2rem
background: $code-background
color: $code-foreground
word-wrap: break-word
word-break: break-word
overflow-wrap: break-word
pre
@extend $code-block
padding: 10px 20px
code
padding: 0
background: none
color: $highlight-foreground
text-shadow: none
figure.highlight
@extend $code-block
position: relative
pre
margin: 0
padding: 8px 0
border: none
.line
if wordWrap
&:before
display: inline-block
padding: 0 .3rem 0 0
min-width: 1.6rem
color: $highlight-gutter.color
content: counter(line)
counter-increment: line
text-align: left
&.marked
background-color: $highlight-selection
table
display: block
overflow: auto
border: none
td
padding: 0
border: none
figcaption
clearfix()
padding: .3rem 0 .1rem .7rem
font-size: 1em
line-height: 1em
a
float: right
padding-right: 10px
color: $highlight-foreground
&:hover
border-bottom-color: $highlight-foreground
.gutter pre
padding-right: .5rem
padding-left: .5rem
background-color: $highlight-gutter.bg-color
color: $highlight-gutter.color
text-align: right
.code pre
padding-right: .5rem
padding-left: .5rem
width: 100%
.highlight-tools
position: relative
display: flex
align-items: center
overflow: hidden
min-height: 1.2rem
height: 2.15em
background: $highlight-tools.bg-color
color: $highlight-tools.color
&.closed + table
display: none
.expand
position: absolute
padding: .4rem .7rem
cursor: pointer
transition: transform .3s
& + .code-lang
left: 1.7rem
&.closed
transition: all .3s
transform: rotate(-90deg) !important
.code-lang
position: absolute
left: .7rem
text-transform: capitalize
font-weight: bold
font-size: 1.15em
.copy-notice
position: absolute
right: 1.7rem
opacity: 0
.copy-button
position: absolute
right: .7rem
cursor: pointer
transition: color .2s
&:hover
color: $theme-color
.gutter
user-select: none
.gist table
width: auto
td
border: none
if $highlight_theme == 'mac' || ($highlight_theme == 'mac light')
figure.highlight
margin: 0 0 1.2rem
border-radius: 7px
box-shadow: 0 5px 10px 0 $highlight-mac-border
-webkit-transform: translateZ(0)
.highlight-tools
&:after
position: absolute
left: .7rem
width: 12px
height: 12px
border-radius: 50%
background: #fc625d
box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b
content: ' '
.expand
right: 0
&.closed
transition: all .3s
transform: rotate(90deg) !important
& ~ .copy-notice
right: 2.8rem
& ~ .copy-button
right: 1.8rem
.code-lang
left: 3.8rem !important