Skip to content

Commit 0fc70e2

Browse files
committed
fix(theme): show filled nav bar when nav screen is open
1 parent d348da7 commit 0fc70e2

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Diff for: src/client/theme-default/components/VPNavBar.vue

+9-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import VPNavBarSocialLinks from './VPNavBarSocialLinks.vue'
1212
import VPNavBarTitle from './VPNavBarTitle.vue'
1313
import VPNavBarTranslations from './VPNavBarTranslations.vue'
1414
15-
defineProps<{
15+
const props = defineProps<{
1616
isScreenOpen: boolean
1717
}>()
1818
@@ -31,6 +31,7 @@ watchPostEffect(() => {
3131
'has-sidebar': hasSidebar.value,
3232
'home': frontmatter.value.layout === 'home',
3333
'top': y.value === 0,
34+
'screen-open': props.isScreenOpen
3435
}
3536
})
3637
</script>
@@ -74,7 +75,13 @@ watchPostEffect(() => {
7475
height: var(--vp-nav-height);
7576
pointer-events: none;
7677
white-space: nowrap;
77-
transition: background-color 0.5s;
78+
transition: background-color 0.25s;
79+
}
80+
81+
.VPNavBar.screen-open {
82+
transition: none;
83+
background-color: var(--vp-nav-bg-color);
84+
border-bottom: 1px solid var(--vp-c-divider);
7885
}
7986
8087
.VPNavBar:not(.home) {

Diff for: src/client/theme-default/components/VPNavScreen.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const isLocked = useScrollLock(inBrowser ? document.body : null)
3737
<style scoped>
3838
.VPNavScreen {
3939
position: fixed;
40-
top: calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 1px);
40+
top: calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px));
4141
/*rtl:ignore*/
4242
right: 0;
4343
bottom: 0;
@@ -47,7 +47,7 @@ const isLocked = useScrollLock(inBrowser ? document.body : null)
4747
width: 100%;
4848
background-color: var(--vp-nav-screen-bg-color);
4949
overflow-y: auto;
50-
transition: background-color 0.5s;
50+
transition: background-color 0.25s;
5151
pointer-events: auto;
5252
}
5353

0 commit comments

Comments
 (0)