diff --git a/src/client/theme-default/Layout.vue b/src/client/theme-default/Layout.vue
index ffaf6b9c..a18fb9c9 100644
--- a/src/client/theme-default/Layout.vue
+++ b/src/client/theme-default/Layout.vue
@@ -22,6 +22,7 @@ watch(() => route.path, closeSidebar)
useCloseSidebarOnEscape(isSidebarOpen, closeSidebar)
provide('close-sidebar', closeSidebar)
+provide('is-sidebar-open', isSidebarOpen)
const { frontmatter } = useData()
diff --git a/src/client/theme-default/components/VPSidebarLink.vue b/src/client/theme-default/components/VPSidebarLink.vue
index 00775138..4052f2f5 100644
--- a/src/client/theme-default/components/VPSidebarLink.vue
+++ b/src/client/theme-default/components/VPSidebarLink.vue
@@ -1,11 +1,12 @@
diff --git a/src/client/theme-default/composables/sidebar.ts b/src/client/theme-default/composables/sidebar.ts
index 7cb1b055..e5bb53fe 100644
--- a/src/client/theme-default/composables/sidebar.ts
+++ b/src/client/theme-default/composables/sidebar.ts
@@ -1,10 +1,12 @@
import { computed, onMounted, onUnmounted, Ref, ref, watchEffect } from 'vue'
import { useData, useRoute } from 'vitepress'
+import { useMediaQuery } from '@vueuse/core'
import { getSidebar } from '../support/sidebar.js'
export function useSidebar() {
const route = useRoute()
const { theme, frontmatter } = useData()
+ const is960 = useMediaQuery('(min-width: 960px)')
const isOpen = ref(false)
@@ -28,6 +30,8 @@ export function useSidebar() {
)
})
+ const isSidebarEnabled = computed(() => hasSidebar.value && is960.value)
+
function open() {
isOpen.value = true
}
@@ -45,6 +49,7 @@ export function useSidebar() {
sidebar,
hasSidebar,
hasAside,
+ isSidebarEnabled,
open,
close,
toggle