fix(theme): fix doc footer's prev and next's size difference (#2600)

pull/2635/head
Aelita 1 year ago committed by GitHub
parent 9fdee9c2a3
commit f52a2629a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -41,20 +41,20 @@ const showFooter = computed(() => {
</div> </div>
</div> </div>
<div v-if="control.prev?.link || control.next?.link" class="prev-next"> <nav v-if="control.prev?.link || control.next?.link" class="prev-next">
<div class="pager"> <div class="pager">
<a v-if="control.prev?.link" class="pager-link prev" :href="normalizeLink(control.prev.link)"> <a v-if="control.prev?.link" class="pager-link prev" :href="normalizeLink(control.prev.link)">
<span class="desc" v-html="theme.docFooter?.prev || 'Previous page'"></span> <span class="desc" v-html="theme.docFooter?.prev || 'Previous page'"></span>
<span class="title" v-html="control.prev.text"></span> <span class="title" v-html="control.prev.text"></span>
</a> </a>
</div> </div>
<div class="pager" :class="{ 'has-prev': control.prev?.link }"> <div class="pager">
<a v-if="control.next?.link" class="pager-link next" :href="normalizeLink(control.next.link)"> <a v-if="control.next?.link" class="pager-link next" :href="normalizeLink(control.next.link)">
<span class="desc" v-html="theme.docFooter?.next || 'Next page'"></span> <span class="desc" v-html="theme.docFooter?.next || 'Next page'"></span>
<span class="title" v-html="control.next.text"></span> <span class="title" v-html="control.next.text"></span>
</a> </a>
</div> </div>
</div> </nav>
</footer> </footer>
</template> </template>
@ -101,29 +101,14 @@ const showFooter = computed(() => {
.prev-next { .prev-next {
border-top: 1px solid var(--vp-c-divider); border-top: 1px solid var(--vp-c-divider);
padding-top: 24px; padding-top: 24px;
display: grid;
grid-row-gap: 8px;
} }
@media (min-width: 640px) { @media (min-width: 640px) {
.prev-next { .prev-next {
display: flex; grid-template-columns: repeat(2, 1fr);
} grid-column-gap: 16px;
}
.pager.has-prev {
padding-top: 8px;
}
@media (min-width: 640px) {
.pager {
display: flex;
flex-direction: column;
flex-shrink: 0;
width: 50%;
}
.pager.has-prev {
padding-top: 0;
padding-left: 16px;
} }
} }

Loading…
Cancel
Save