Skip to content

Commit f52a262

Browse files
authored
fix(theme): fix doc footer's prev and next's size difference (#2600)
1 parent 9fdee9c commit f52a262

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

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

+7-22
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,20 @@ const showFooter = computed(() => {
4141
</div>
4242
</div>
4343

44-
<div v-if="control.prev?.link || control.next?.link" class="prev-next">
44+
<nav v-if="control.prev?.link || control.next?.link" class="prev-next">
4545
<div class="pager">
4646
<a v-if="control.prev?.link" class="pager-link prev" :href="normalizeLink(control.prev.link)">
4747
<span class="desc" v-html="theme.docFooter?.prev || 'Previous page'"></span>
4848
<span class="title" v-html="control.prev.text"></span>
4949
</a>
5050
</div>
51-
<div class="pager" :class="{ 'has-prev': control.prev?.link }">
51+
<div class="pager">
5252
<a v-if="control.next?.link" class="pager-link next" :href="normalizeLink(control.next.link)">
5353
<span class="desc" v-html="theme.docFooter?.next || 'Next page'"></span>
5454
<span class="title" v-html="control.next.text"></span>
5555
</a>
5656
</div>
57-
</div>
57+
</nav>
5858
</footer>
5959
</template>
6060

@@ -101,29 +101,14 @@ const showFooter = computed(() => {
101101
.prev-next {
102102
border-top: 1px solid var(--vp-c-divider);
103103
padding-top: 24px;
104+
display: grid;
105+
grid-row-gap: 8px;
104106
}
105107
106108
@media (min-width: 640px) {
107109
.prev-next {
108-
display: flex;
109-
}
110-
}
111-
112-
.pager.has-prev {
113-
padding-top: 8px;
114-
}
115-
116-
@media (min-width: 640px) {
117-
.pager {
118-
display: flex;
119-
flex-direction: column;
120-
flex-shrink: 0;
121-
width: 50%;
122-
}
123-
124-
.pager.has-prev {
125-
padding-top: 0;
126-
padding-left: 16px;
110+
grid-template-columns: repeat(2, 1fr);
111+
grid-column-gap: 16px;
127112
}
128113
}
129114

0 commit comments

Comments
 (0)