mirror of
https://github.com/sendevia/website.git
synced 2026-03-05 23:32:45 +08:00
初始化代码高亮样式
This commit is contained in:
53
.vitepress/theme/styles/_components/code.scss
Normal file
53
.vitepress/theme/styles/_components/code.scss
Normal file
@@ -0,0 +1,53 @@
|
||||
@use "../mixin";
|
||||
|
||||
// code
|
||||
|
||||
pre.shiki {
|
||||
position: relative;
|
||||
|
||||
margin-block: 0px;
|
||||
|
||||
code {
|
||||
@include mixin.typescale-style("body-large", $font-family: Source Code Pro);
|
||||
display: inline-block;
|
||||
|
||||
margin: 0px;
|
||||
|
||||
min-height: 46px;
|
||||
width: 100%;
|
||||
|
||||
color: var(--shiki-light);
|
||||
vertical-align: middle;
|
||||
word-break: break-word;
|
||||
|
||||
border-radius: var(--md-sys-shape-corner-medium);
|
||||
|
||||
background-color: var(--shiki-light-bg);
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
color: var(--shiki-dark);
|
||||
|
||||
background-color: var(--shiki-dark-bg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
code.language-plaintext {
|
||||
padding-inline: 4px;
|
||||
|
||||
color: var(--md-sys-color-inverse-surface);
|
||||
text-indent: initial;
|
||||
word-break: break-word;
|
||||
|
||||
border-radius: var(--md-sys-shape-corner-small);
|
||||
|
||||
background-color: var(--md-sys-color-inverse-on-surface);
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
&::selection {
|
||||
color: var(--md-sys-color-on-tertiary);
|
||||
|
||||
background-color: var(--md-sys-color-tertiary);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user