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 @@