diff --git a/app/.vitepress/config.ts b/app/.vitepress/config.ts index 555f5366e1007e3222152eb01ea0ffaf6647f6bc..90411809954aac82337124e22d0d5f31e885f3ce 100644 --- a/app/.vitepress/config.ts +++ b/app/.vitepress/config.ts @@ -1,4 +1,3 @@ -import hljs from 'highlight.js'; import type Markdown from 'markdown-it'; export default { @@ -54,18 +53,9 @@ export default { markdown: { math: true, plantuml: true, - highlight: (code: string, lang: string) => { - try { - return `
${
-          lang && hljs.getLanguage(lang)
-            ? hljs.highlight(code, {
-                language: lang === 'shell' ? 'bash' : lang,
-              }).value
-            : hljs.highlightAuto(code).value
-        }
`; - } catch { - return `
${code}
`; - } + theme: { + light: 'light-plus', + dark: 'dark-plus', }, config: (md: Markdown) => { md.renderer.rules.code_inline = (tokens, idx) => { diff --git a/app/.vitepress/src/assets/style/highlight/atom-one-dark.scss b/app/.vitepress/src/assets/style/highlight/atom-one-dark.scss deleted file mode 100644 index e4bcb4cb22be183e0a9afc13f2df7a1d79c3df7f..0000000000000000000000000000000000000000 --- a/app/.vitepress/src/assets/style/highlight/atom-one-dark.scss +++ /dev/null @@ -1,105 +0,0 @@ -[data-o-theme='dark'] { - pre code.hljs { - display: block; - overflow-x: auto; - padding: 1em; - } - - code.hljs { - padding: 3px 5px; - } - - /* - -Atom One Dark by Daniel Gamage -Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax - -base: #282c34 -mono-1: #abb2bf -mono-2: #818896 -mono-3: #5c6370 -hue-1: #56b6c2 -hue-2: #61aeee -hue-3: #c678dd -hue-4: #98c379 -hue-5: #e06c75 -hue-5-2: #be5046 -hue-6: #d19a66 -hue-6-2: #e6c07b - -*/ - .hljs { - color: #abb2bf; - background: #2b2b2f; - } - - .hljs-comment, - .hljs-quote { - color: #5c6370; - font-style: italic; - } - - .hljs-doctag, - .hljs-keyword, - .hljs-formula { - color: #c678dd; - } - - .hljs-section, - .hljs-name, - .hljs-selector-tag, - .hljs-deletion, - .hljs-subst { - color: #e06c75; - } - - .hljs-literal { - color: #56b6c2; - } - - .hljs-string, - .hljs-regexp, - .hljs-addition, - .hljs-attribute, - .hljs-meta .hljs-string { - color: #98c379; - } - - .hljs-attr, - .hljs-variable, - .hljs-template-variable, - .hljs-type, - .hljs-selector-class, - .hljs-selector-attr, - .hljs-selector-pseudo, - .hljs-number { - color: #d19a66; - } - - .hljs-symbol, - .hljs-bullet, - .hljs-link, - .hljs-meta, - .hljs-selector-id, - .hljs-title { - color: #61aeee; - } - - .hljs-built_in, - .hljs-title.class_, - .hljs-class .hljs-title { - color: #e6c07b; - } - - .hljs-emphasis { - font-style: italic; - } - - .hljs-strong { - font-weight: bold; - } - - .hljs-link { - text-decoration: underline; - } -} \ No newline at end of file diff --git a/app/.vitepress/src/assets/style/highlight/atom-one-light.scss b/app/.vitepress/src/assets/style/highlight/atom-one-light.scss deleted file mode 100644 index a9c5c2bba06e2a7c59a848dbc507f1a69d6149e3..0000000000000000000000000000000000000000 --- a/app/.vitepress/src/assets/style/highlight/atom-one-light.scss +++ /dev/null @@ -1,103 +0,0 @@ -pre code.hljs { - display: block; - overflow-x: auto; - padding: 1em; -} - -code.hljs { - padding: 3px 5px; -} - -/* - -Atom One Light by Daniel Gamage -Original One Light Syntax theme from https://github.com/atom/one-light-syntax - -base: #fafafa -mono-1: #383a42 -mono-2: #686b77 -mono-3: #a0a1a7 -hue-1: #0184bb -hue-2: #4078f2 -hue-3: #a626a4 -hue-4: #50a14f -hue-5: #e45649 -hue-5-2: #c91243 -hue-6: #986801 -hue-6-2: #c18401 - -*/ -.hljs { - color: #383a42; - background: #f3f3f5; -} - -.hljs-comment, -.hljs-quote { - color: #a0a1a7; - font-style: italic; -} - -.hljs-doctag, -.hljs-keyword, -.hljs-formula { - color: #a626a4; -} - -.hljs-section, -.hljs-name, -.hljs-selector-tag, -.hljs-deletion, -.hljs-subst { - color: #e45649; -} - -.hljs-literal { - color: #0184bb; -} - -.hljs-string, -.hljs-regexp, -.hljs-addition, -.hljs-attribute, -.hljs-meta .hljs-string { - color: #50a14f; -} - -.hljs-attr, -.hljs-variable, -.hljs-template-variable, -.hljs-type, -.hljs-selector-class, -.hljs-selector-attr, -.hljs-selector-pseudo, -.hljs-number { - color: #986801; -} - -.hljs-symbol, -.hljs-bullet, -.hljs-link, -.hljs-meta, -.hljs-selector-id, -.hljs-title { - color: #4078f2; -} - -.hljs-built_in, -.hljs-title.class_, -.hljs-class .hljs-title { - color: #c18401; -} - -.hljs-emphasis { - font-style: italic; -} - -.hljs-strong { - font-weight: bold; -} - -.hljs-link { - text-decoration: underline; -} \ No newline at end of file diff --git a/app/.vitepress/src/assets/style/highlight/index.scss b/app/.vitepress/src/assets/style/highlight/index.scss index ebc41ab6a58bc1ed468d33e69c1376d3ca2a2acb..1959ffa576ee5368f58c1f9c1bc29d0300a900e2 100644 --- a/app/.vitepress/src/assets/style/highlight/index.scss +++ b/app/.vitepress/src/assets/style/highlight/index.scss @@ -1,2 +1,8 @@ -@import './atom-one-light.scss'; -@import './atom-one-dark.scss'; \ No newline at end of file +html:not(.dark) code span { + color: var(--shiki-light, inherit); +} + +[data-o-theme="dark"] code span { + color: var(--shiki-dark, inherit); +} + diff --git a/app/.vitepress/src/assets/style/markdown.scss b/app/.vitepress/src/assets/style/markdown.scss index dc1eabcab8fc000bf329b8202d4c6f5d6b212ea5..03da5ca15064ccfd8364b7d7fac8516c2a18a2f2 100644 --- a/app/.vitepress/src/assets/style/markdown.scss +++ b/app/.vitepress/src/assets/style/markdown.scss @@ -59,7 +59,7 @@ min-height: auto; @include text1; - &>div *:first-child { + & > div *:first-child { margin-top: 0 !important; } @@ -87,7 +87,7 @@ margin-top: var(--o-gap-2); } - li+li { + li + li { margin-top: 0; } @@ -275,7 +275,7 @@ margin-bottom: 0; } - *+* { + * + * { margin-top: var(--o-gap-2); } @@ -344,14 +344,6 @@ } } - .vp-code { - &.shiki { - span { - color: var(--shiki-light, inherit); - } - } - } - .custom-block { padding: var(--o-gap-3) var(--o-gap-4); margin-bottom: var(--o-gap-3); @@ -461,4 +453,4 @@ background-image: url('@/assets/category/docs/icon-copy-dark.svg'); } } -} \ No newline at end of file +}