From dcbd1d3e51d6de18650d86fa8b6dc6c79df59c03 Mon Sep 17 00:00:00 2001
From: hmol233 <82594500+hmol233@users.noreply.github.com>
Date: Fri, 28 May 2021 22:11:48 +0800
Subject: [PATCH] Upgrade vuepress to beta.15
- use official dark theme
- fix: Fix Tabs
---
docs/.vuepress/styles/index.scss | 32 ++
docs/.vuepress/theme/README.md | 4 +-
docs/.vuepress/theme/clientAppEnhance.ts | 2 -
docs/.vuepress/theme/components/Tab.vue | 11 +-
docs/.vuepress/theme/components/Tabs.vue | 17 +-
.../theme/components/ThemeToggle.vue | 46 --
docs/.vuepress/theme/index.ts | 3 -
docs/.vuepress/theme/layouts/Layout.vue | 31 --
.../theme/styles/default/_color.scss | 43 --
.../theme/styles/default/_normalize.scss | 51 --
.../theme/styles/default/_variables.scss | 71 ---
.../.vuepress/theme/styles/default/arrow.scss | 27 --
.../.vuepress/theme/styles/default/badge.scss | 17 -
docs/.vuepress/theme/styles/default/code.scss | 26 --
.../styles/default/custom-container.scss | 42 --
.../theme/styles/default/dropdown.scss | 47 --
docs/.vuepress/theme/styles/default/home.scss | 51 --
.../.vuepress/theme/styles/default/index.scss | 44 --
.../theme/styles/default/layout.scss | 19 -
.../theme/styles/default/navbar.scss | 34 --
docs/.vuepress/theme/styles/default/page.scss | 21 -
.../theme/styles/default/plugins.scss | 18 -
.../theme/styles/default/sidebar.scss | 27 --
docs/.vuepress/theme/types/index.ts | 1 -
docs/.vuepress/theme/types/toggle.ts | 4 -
package.json | 11 +-
yarn.lock | 436 +++++++++---------
27 files changed, 281 insertions(+), 855 deletions(-)
create mode 100644 docs/.vuepress/styles/index.scss
delete mode 100644 docs/.vuepress/theme/components/ThemeToggle.vue
delete mode 100644 docs/.vuepress/theme/layouts/Layout.vue
delete mode 100644 docs/.vuepress/theme/styles/default/_color.scss
delete mode 100644 docs/.vuepress/theme/styles/default/_normalize.scss
delete mode 100644 docs/.vuepress/theme/styles/default/_variables.scss
delete mode 100644 docs/.vuepress/theme/styles/default/arrow.scss
delete mode 100644 docs/.vuepress/theme/styles/default/badge.scss
delete mode 100644 docs/.vuepress/theme/styles/default/code.scss
delete mode 100644 docs/.vuepress/theme/styles/default/custom-container.scss
delete mode 100644 docs/.vuepress/theme/styles/default/dropdown.scss
delete mode 100644 docs/.vuepress/theme/styles/default/home.scss
delete mode 100644 docs/.vuepress/theme/styles/default/index.scss
delete mode 100644 docs/.vuepress/theme/styles/default/layout.scss
delete mode 100644 docs/.vuepress/theme/styles/default/navbar.scss
delete mode 100644 docs/.vuepress/theme/styles/default/page.scss
delete mode 100644 docs/.vuepress/theme/styles/default/plugins.scss
delete mode 100644 docs/.vuepress/theme/styles/default/sidebar.scss
delete mode 100644 docs/.vuepress/theme/types/index.ts
delete mode 100644 docs/.vuepress/theme/types/toggle.ts
diff --git a/docs/.vuepress/styles/index.scss b/docs/.vuepress/styles/index.scss
new file mode 100644
index 0000000..b0e6d62
--- /dev/null
+++ b/docs/.vuepress/styles/index.scss
@@ -0,0 +1,32 @@
+:root {
+ --c-brand: #407ce8;
+ --c-brand-light: #2e73ea;
+}
+
+html.dark {
+ --c-brand: #407ce8;
+ --c-brand-light: #2e73ea;
+ --c-warning-bg: rgba(185, 174, 119, 0.3);
+ --c-warning-text: #c0bebe;
+ --c-warning-text-accent: var(--c-text-accent);
+
+ --c-danger-title: #b40505;
+ --c-danger-bg: rgba(72, 56, 57, 0.3);
+ --c-danger-text: #c0bebe;
+
+ --c-bg-light: rgba(255, 255, 255, 0.1);
+}
+
+blockquote {
+ color: var(--c-text);
+ background-color: var(--c-bg-lighter);
+ border-left: 4px solid #17a2b8;
+}
+
+* {
+ scroll-behavior: smooth;
+ transition: background-color 0.1s ease;
+ @media screen and (prefers-reduced-motion: reduce) {
+ scroll-behavior: auto;
+ }
+}
diff --git a/docs/.vuepress/theme/README.md b/docs/.vuepress/theme/README.md
index 4ea07af..d551b28 100644
--- a/docs/.vuepress/theme/README.md
+++ b/docs/.vuepress/theme/README.md
@@ -1,3 +1 @@
-# Xray-docs-next dark theme
-
-Fork from https://github.com/tolking/vuepress-theme-default-prefers-color-scheme .
+# Xray-docs-next theme
diff --git a/docs/.vuepress/theme/clientAppEnhance.ts b/docs/.vuepress/theme/clientAppEnhance.ts
index 999c0da..90af952 100644
--- a/docs/.vuepress/theme/clientAppEnhance.ts
+++ b/docs/.vuepress/theme/clientAppEnhance.ts
@@ -2,8 +2,6 @@ import { defineClientAppEnhance } from "@vuepress/client";
import Tab from "./components/Tab.vue";
import Tabs from "./components/Tabs.vue";
-import "./styles/default/index.scss";
-
export default defineClientAppEnhance(({ app, router, siteData }) => {
app.component("Tab", Tab);
app.component("Tabs", Tabs);
diff --git a/docs/.vuepress/theme/components/Tab.vue b/docs/.vuepress/theme/components/Tab.vue
index 7a4b2e7..3bbd6ed 100644
--- a/docs/.vuepress/theme/components/Tab.vue
+++ b/docs/.vuepress/theme/components/Tab.vue
@@ -22,11 +22,16 @@ export default defineComponent({
let tag = this.title;
return {
tabID: tag,
- labelID: tag + "-" + "label",
};
},
- beforeMount() {
- this.$parent.$data.children.push(this);
+ mounted() {
+ this.tabID = "tab-" + Math.random().toString(36).substring(2);
+ this.$parent.$data.children.push({ id: this.tabID, title: this.title });
+ },
+ computed: {
+ labelID(): String {
+ return this.tabID + "-label";
+ },
},
});
diff --git a/docs/.vuepress/theme/components/Tabs.vue b/docs/.vuepress/theme/components/Tabs.vue
index c077512..2d4c9ea 100644
--- a/docs/.vuepress/theme/components/Tabs.vue
+++ b/docs/.vuepress/theme/components/Tabs.vue
@@ -4,9 +4,9 @@