Skip to content

Commit 1909041

Browse files
committedMar 10, 2024·
fix(theme): local nav separator not visible on pages having no outline
1 parent 86c0967 commit 1909041

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed
 

‎src/client/theme-default/components/VPNavBar.vue

+10-12
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import { useWindowScroll } from '@vueuse/core'
33
import { ref, watchPostEffect } from 'vue'
44
import { useData } from '../composables/data'
5-
import { useLocalNav } from '../composables/local-nav'
65
import { useSidebar } from '../composables/sidebar'
76
import VPNavBarAppearance from './VPNavBarAppearance.vue'
87
import VPNavBarExtra from './VPNavBarExtra.vue'
@@ -23,16 +22,15 @@ defineEmits<{
2322
2423
const { y } = useWindowScroll()
2524
const { hasSidebar } = useSidebar()
26-
const { hasLocalNav } = useLocalNav()
2725
const { frontmatter } = useData()
2826
2927
const classes = ref<Record<string, boolean>>({})
3028
3129
watchPostEffect(() => {
3230
classes.value = {
3331
'has-sidebar': hasSidebar.value,
34-
'has-local-nav': hasLocalNav.value,
35-
top: frontmatter.value.layout === 'home' && y.value === 0,
32+
'home': frontmatter.value.layout === 'home',
33+
'top': y.value === 0,
3634
}
3735
})
3836
</script>
@@ -79,16 +77,16 @@ watchPostEffect(() => {
7977
transition: background-color 0.5s;
8078
}
8179
82-
.VPNavBar.has-local-nav {
80+
.VPNavBar:not(.home) {
8381
background-color: var(--vp-nav-bg-color);
8482
}
8583
8684
@media (min-width: 960px) {
87-
.VPNavBar.has-local-nav {
85+
.VPNavBar:not(.home) {
8886
background-color: transparent;
8987
}
9088
91-
.VPNavBar:not(.has-sidebar):not(.top) {
89+
.VPNavBar:not(.has-sidebar):not(.home.top) {
9290
background-color: var(--vp-nav-bg-color);
9391
}
9492
}
@@ -188,12 +186,12 @@ watchPostEffect(() => {
188186
}
189187
190188
@media (min-width: 960px) {
191-
.VPNavBar:not(.top) .content-body {
189+
.VPNavBar:not(.home.top) .content-body {
192190
position: relative;
193191
background-color: var(--vp-nav-bg-color);
194192
}
195193
196-
.VPNavBar:not(.has-sidebar):not(.top) .content-body {
194+
.VPNavBar:not(.has-sidebar):not(.home.top) .content-body {
197195
background-color: transparent;
198196
}
199197
}
@@ -253,16 +251,16 @@ watchPostEffect(() => {
253251
transition: background-color 0.5s;
254252
}
255253
256-
.VPNavBar.has-local-nav .divider-line {
254+
.VPNavBar:not(.home) .divider-line {
257255
background-color: var(--vp-c-gutter);
258256
}
259257
260258
@media (min-width: 960px) {
261-
.VPNavBar:not(.top) .divider-line {
259+
.VPNavBar:not(.home.top) .divider-line {
262260
background-color: var(--vp-c-gutter);
263261
}
264262
265-
.VPNavBar:not(.has-sidebar):not(.top) .divider {
263+
.VPNavBar:not(.has-sidebar):not(.home.top) .divider {
266264
background-color: var(--vp-c-gutter);
267265
}
268266
}

0 commit comments

Comments
 (0)
Please sign in to comment.