From 41247fcfa0733204fdfea68eb2721cf85510ffca Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Mon, 30 May 2022 15:09:54 +0800 Subject: [PATCH] feat: support dark/light color themes (#682) Co-authored-by: Kia Ishii --- docs/config/app-configs.md | 2 +- docs/guide/using-vue.md | 6 ++--- src/client/theme-default/index.ts | 1 + .../styles/components/vp-code.css | 7 +++++ .../styles/components/vp-doc.css | 6 ++--- src/client/theme-default/styles/vars.css | 13 +++++++--- src/node/markdown/markdown.ts | 4 ++- src/node/markdown/plugins/highlight.ts | 26 ++++++++++++++----- 8 files changed, 48 insertions(+), 17 deletions(-) create mode 100644 src/client/theme-default/styles/components/vp-code.css diff --git a/docs/config/app-configs.md b/docs/config/app-configs.md index 47adbec8..ee355c88 100644 --- a/docs/config/app-configs.md +++ b/docs/config/app-configs.md @@ -102,7 +102,7 @@ Below shows the the full option you may define within this object. interface MarkdownOptions extends MarkdownIt.Options { // Syntax highlight theme for Shiki. // See: https://github.com/shikijs/shiki/blob/main/docs/themes.md#all-themes - theme?: Shiki.Theme + theme?: Shiki.Theme | { light: Shiki.Theme, dark: Shiki.Theme } // Enable line numbers in code block. lineNumbers?: boolean diff --git a/docs/guide/using-vue.md b/docs/guide/using-vue.md index 8ed6b0aa..998d3aa8 100644 --- a/docs/guide/using-vue.md +++ b/docs/guide/using-vue.md @@ -26,8 +26,8 @@ Directives also work: **Input** -```md -{{ i }} +```html +{{ i }} ``` **Output** @@ -40,7 +40,7 @@ You can use the [`useData` helper](./api#usedata) in a `