Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(theme): add --vp-layout-top-height to adjust banner #1521

Merged
merged 8 commits into from Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/client/theme-default/components/VPContent.vue
Expand Up @@ -63,7 +63,7 @@ const NotFound = inject('NotFound')

@media (min-width: 960px) {
.VPContent {
padding-top: var(--vp-nav-height);
padding-top: calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px));
}

.VPContent.has-sidebar {
Expand Down
6 changes: 3 additions & 3 deletions src/client/theme-default/components/VPDoc.vue
Expand Up @@ -120,8 +120,8 @@ provide('onContentUpdated', onContentUpdated)
.aside-container {
position: sticky;
top: 0;
margin-top: calc(var(--vp-nav-height-desktop) * -1 - 32px);
padding-top: calc(var(--vp-nav-height-desktop) + 32px);
margin-top: calc((var(--vp-nav-height-desktop) + var(--vp-layout-top-height, 0px)) * -1 - 32px);
padding-top: calc(var(--vp-nav-height-desktop) + var(--vp-layout-top-height, 0px) + 32px);
height: 100vh;
overflow-x: hidden;
overflow-y: auto;
Expand All @@ -144,7 +144,7 @@ provide('onContentUpdated', onContentUpdated)
.aside-content {
display: flex;
flex-direction: column;
min-height: calc(100vh - (var(--vp-nav-height-desktop) + 32px));
min-height: calc(100vh - (var(--vp-nav-height-desktop) + var(--vp-layout-top-height, 0px) + 32px));
padding-bottom: 32px;
}

Expand Down
8 changes: 4 additions & 4 deletions src/client/theme-default/components/VPHero.vue
Expand Up @@ -53,19 +53,19 @@ defineProps<{

<style scoped>
.VPHero {
margin-top: calc(var(--vp-nav-height) * -1);
padding: calc(var(--vp-nav-height) + 48px) 24px 48px;
margin-top: calc((var(--vp-nav-height) + var(--vp-layout-top-height, 0px)) * -1);
padding: calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 48px) 24px 48px;
}

@media (min-width: 640px) {
.VPHero {
padding: calc(var(--vp-nav-height) + 80px) 48px 64px;
padding: calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 80px) 48px 64px;
}
}

@media (min-width: 960px) {
.VPHero {
padding: calc(var(--vp-nav-height) + 80px) 64px 64px;
padding: calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 80px) 64px 64px;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/client/theme-default/components/VPNav.vue
Expand Up @@ -29,7 +29,7 @@ provide('close-screen', closeScreen)
<style scoped>
.VPNav {
position: relative;
top: 0;
top: var(--vp-layout-top-height, 0px);
left: 0;
z-index: var(--vp-z-index-nav);
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion src/client/theme-default/components/VPNavScreen.vue
Expand Up @@ -43,7 +43,7 @@ function unlockBodyScroll() {
<style scoped>
.VPNavScreen {
position: fixed;
top: var(--vp-nav-height-mobile);
top: calc(var(--vp-nav-height-mobile) + var(--vp-layout-top-height, 0px));
right: 0;
bottom: 0;
left: 0;
Expand Down
2 changes: 1 addition & 1 deletion src/client/theme-default/components/VPSidebar.vue
Expand Up @@ -59,7 +59,7 @@ watchPostEffect(async () => {
<style scoped>
.VPSidebar {
position: fixed;
top: 0;
top: var(--vp-layout-top-height, 0px);
bottom: 0;
left: 0;
z-index: var(--vp-z-index-sidebar);
Expand Down
7 changes: 4 additions & 3 deletions src/client/theme-default/styles/vars.css
Expand Up @@ -172,9 +172,10 @@
:root {
--vp-z-index-local-nav: 10;
--vp-z-index-nav: 20;
--vp-z-index-backdrop: 30;
--vp-z-index-sidebar: 40;
--vp-z-index-footer: 50;
--vp-z-index-layout-top: 30;
--vp-z-index-backdrop: 40;
--vp-z-index-sidebar: 50;
--vp-z-index-footer: 60;
}

/**
Expand Down