feat(cli): improve code highlight (#11569)

This commit is contained in:
neverland 2023-02-12 10:22:27 +08:00 committed by GitHub
parent 9cbb2f56fa
commit 267f23dc58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 7 deletions

View File

@ -6,7 +6,7 @@ code {
color: var(--van-doc-code-color);
font-weight: 400;
font-size: 14px;
font-family: 'Source Code Pro', 'Monaco', 'Inconsolata', monospace;
font-family: var(--van-doc-code-font-family);
line-height: 26px;
white-space: pre-wrap;
word-wrap: break-word;

View File

@ -12,6 +12,7 @@
--van-doc-gray-8: #323233;
--van-doc-blue: #1989fa;
--van-doc-green: #07c160;
--van-doc-purple: #8e69d3;
// sizes
--van-doc-padding: 32px;
@ -21,6 +22,10 @@
--van-doc-simulator-width: 360px;
--van-doc-simulator-height: 620px;
--van-doc-header-top-height: 64px;
// fonts
--van-doc-code-font-family: 'Menlo', 'Source Code Pro', 'Monaco',
'Inconsolata', monospace;
}
.van-doc-theme-light {

View File

@ -245,7 +245,7 @@ export default {
display: inline-block;
color: var(--van-doc-green);
font-size: 14px;
font-family: 'Source Code Pro', 'Monaco', 'Inconsolata', monospace;
font-family: var(--van-doc-code-font-family);
font-style: normal;
max-width: 300px;
-webkit-font-smoothing: auto;
@ -291,13 +291,12 @@ export default {
> table code {
display: inline;
margin: 0 2px;
padding: 2px 5px;
padding: 3px 7px;
font-size: 14px;
font-family: inherit;
font-weight: 600;
word-break: keep-all;
border-radius: 4px;
-webkit-font-smoothing: antialiased;
border-radius: 6px;
-webkit-font-smoothing: auto;
font-family: var(--van-doc-code-font-family);
}
> blockquote {