feat(theme): allow footer and siderbar to be displayed at the same time

pull/4532/head
yuyinws 8 months ago
parent c2ab5b03a8
commit 8a9fcc3fdd
No known key found for this signature in database
GPG Key ID: 066DDFA8B76EA147

@ -7,7 +7,11 @@ const { hasSidebar } = useSidebar()
</script> </script>
<template> <template>
<footer v-if="theme.footer && frontmatter.footer !== false" class="VPFooter" :class="{ 'has-sidebar': hasSidebar }"> <footer
v-if="theme.footer && frontmatter.footer !== false && (!hasSidebar || theme.footer.showWithSidebar)"
class="VPFooter"
:class="{ 'has-sidebar': hasSidebar }"
>
<div class="container"> <div class="container">
<p v-if="theme.footer.message" class="message" v-html="theme.footer.message"></p> <p v-if="theme.footer.message" class="message" v-html="theme.footer.message"></p>
<p v-if="theme.footer.copyright" class="copyright" v-html="theme.footer.copyright"></p> <p v-if="theme.footer.copyright" class="copyright" v-html="theme.footer.copyright"></p>
@ -24,10 +28,6 @@ const { hasSidebar } = useSidebar()
background-color: var(--vp-c-bg); background-color: var(--vp-c-bg);
} }
.VPFooter.has-sidebar {
display: none;
}
.VPFooter :deep(a) { .VPFooter :deep(a) {
text-decoration-line: underline; text-decoration-line: underline;
text-underline-offset: 2px; text-underline-offset: 2px;
@ -50,6 +50,12 @@ const { hasSidebar } = useSidebar()
text-align: center; text-align: center;
} }
@media (min-width: 960px) {
.has-sidebar .container {
padding-left: var(--vp-sidebar-width);
}
}
.message, .message,
.copyright { .copyright {
line-height: 24px; line-height: 24px;

@ -341,6 +341,7 @@ export namespace DefaultTheme {
export interface Footer { export interface Footer {
message?: string message?: string
copyright?: string copyright?: string
showWithSidebar?: boolean
} }
// team ---------------------------------------------------------------------- // team ----------------------------------------------------------------------

Loading…
Cancel
Save