vuepress-theme-ououe
Version:
A blog theme for VuePress by tolking
230 lines (203 loc) • 4.41 kB
text/stylus
.content
code
color lighten($textColor, 20%)
padding 0.25rem 0.5rem
margin 0
font-size .85em
background-color rgba(27,31,35,0.05)
border-radius 3px
transition all .5s ease-in-out
@media (prefers-color-scheme: dark)
color #578dc1
background-color #444
@media print
color $textColor
background-color transparent
page-break-inside avoid
.token
&.deleted
color #EC5975
&.inserted
color $accentColor
.content
pre, pre[class*="language-"]
line-height 1.4
padding 1.25rem 1.5rem
margin 0.85rem 0
background-color $codeBgColor
border-radius 6px
overflow auto
@media print
background-color transparent
page-break-inside avoid
code
color #eee
padding 0
background-color transparent
border-radius 0
@media print
color $textColor
white-space pre-wrap
page-break-inside avoid
div[class*="language-"]
position relative
background-color $codeBgColor
border-radius 6px
.highlight-lines
user-select none
padding-top 1.3rem
position absolute
top 0
left 0
width 100%
line-height 1.4
.highlighted
background-color rgba(0, 0, 0, 50%)
@media print
background-color transparent
page-break-inside avoid
pre, pre[class*="language-"]
background transparent
position relative
z-index 1
&::before
position absolute
z-index 3
top 0.8em
right 1em
font-size 0.85em
color rgba(255, 255, 255, 0.4)
@media print
color $textColor
page-break-inside avoid
&:not(.line-numbers-mode)
.line-numbers-wrapper
display none
&.line-numbers-mode
.highlight-lines .highlighted
position relative
&:before
content ' '
position absolute
z-index 3
left 0
top 0
display block
width $lineNumbersWrapperWidth
height 100%
background-color rgba(0, 0, 0, 66%)
@media print
background-color transparent
pre
padding-left $lineNumbersWrapperWidth + 1 rem
vertical-align middle
.line-numbers-wrapper
position absolute
top 0
width $lineNumbersWrapperWidth
text-align center
color rgba(255, 255, 255, 0.3)
padding 1.25rem 0
line-height 1.4
@media print
color $textColor
br
user-select none
.line-number
position relative
z-index 4
user-select none
font-size 0.85em
&::after
content ''
position absolute
z-index 2
top 0
left 0
width $lineNumbersWrapperWidth
height 100%
border-radius 6px 0 0 6px
border-right 1px solid rgba(0, 0, 0, 66%)
background-color $codeBgColor
@media print
border-right 0
page-break-inside avoid
for lang in $codeLang
div{'[class~="language-' + lang + '"]'}
&:before
content ('' + lang)
div[class~="language-javascript"]
&:before
content "js"
div[class~="language-typescript"]
&:before
content "ts"
div[class~="language-markup"]
&:before
content "html"
div[class~="language-markdown"]
&:before
content "md"
div[class~="language-json"]:before
content "json"
div[class~="language-ruby"]:before
content "rb"
div[class~="language-python"]:before
content "py"
div[class~="language-bash"]:before
content "sh"
div[class~="language-php"]:before
content "php"
.token.block-comment,
.token.cdata,
.token.comment,
.token.doctype,
.token.prolog
color #999
.token.punctuation
color #ccc
.token.attr-name,
.token.deleted,
.token.namespace,
.token.tag
color #e2777a
.token.function-name
color #6196cc
.token.boolean,
.token.function,
.token.number
color #f08d49
.token.class-name,
.token.constant,
.token.property,
.token.symbol
color #f8c555
.token.atrule,
.token.builtin,
.token.important,
.token.keyword,
.token.selector
color #cc99cd
.token.attr-value,
.token.char,
.token.regex,
.token.string,
.token.variable
color #7ec699
.token.entity,
.token.operator,
.token.url
color #67cdcc
.token.bold,
.token.important
font-weight:700
.token.italic
font-style:italic
.token.entity
cursor:help
.token.inserted
color green
.token.deleted
color #ec5975
.token.content
padding: 0