Skip to content

Commit

Permalink
feat(theme): add --vt-layout-top-height to adjust banner (#1521)
Browse files Browse the repository at this point in the history
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
  • Loading branch information
ylw5 and brc-dd committed Oct 24, 2022
1 parent b4199bc commit a29a4a6
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
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

0 comments on commit a29a4a6

Please sign in to comment.