From 3f1b27e49f154941292dfe0c8686215740e6561f Mon Sep 17 00:00:00 2001 From: mlmoravek Date: Thu, 26 Jun 2025 17:25:20 +0200 Subject: [PATCH] docs: add dark/light appearance switcher --- packages/docs/.vitepress/config.ts | 1 - .../theme/components/ExampleShowcase.ce.vue | 6 ---- .../theme/components/ExampleViewer.vue | 29 ++++++++++++++++++- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/packages/docs/.vitepress/config.ts b/packages/docs/.vitepress/config.ts index 546109d81..0d3d79036 100644 --- a/packages/docs/.vitepress/config.ts +++ b/packages/docs/.vitepress/config.ts @@ -63,7 +63,6 @@ export default defineConfig({ ['meta', { name: 'twitter:description', content: "Oruga UI is like a caterpillar, minimal and yet functional. It's in your hands turning it into a butterfly." }], ['meta', { name: 'twitter:image', content: 'https://oruga-ui.com/logo-banner.png?v=3' }], ], - appearance: false, themeConfig: { logo: "/logo.png", outline: [2, 4], diff --git a/packages/docs/.vitepress/theme/components/ExampleShowcase.ce.vue b/packages/docs/.vitepress/theme/components/ExampleShowcase.ce.vue index 90ac47e77..aaa24bf05 100644 --- a/packages/docs/.vitepress/theme/components/ExampleShowcase.ce.vue +++ b/packages/docs/.vitepress/theme/components/ExampleShowcase.ce.vue @@ -16,12 +16,6 @@ if (!shadowRoot) throw new Error("ExampleShowcase must be used as web component."); onMounted(() => { - if (host?.children) - // add bulma light theme attribute to the slot content - host.childNodes.forEach((child) => - child.setAttribute("data-theme", "light"), - ); - // The slot content must be moved to the shadow root // for the scoped style above to be applied. if (host?.childNodes) shadowRoot.append(...(host.childNodes ?? [])); diff --git a/packages/docs/.vitepress/theme/components/ExampleViewer.vue b/packages/docs/.vitepress/theme/components/ExampleViewer.vue index 70e58b913..c555a489f 100644 --- a/packages/docs/.vitepress/theme/components/ExampleViewer.vue +++ b/packages/docs/.vitepress/theme/components/ExampleViewer.vue @@ -1,7 +1,9 @@