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

Hide some UI elements when printing #2913

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions src/client/theme-default/components/VPCarbonAds.vue
Expand Up @@ -106,4 +106,10 @@ if (carbonOptions) {
.VPCarbonAds :deep(> div:first-of-type) {
display: block;
}

@media print {
.VPCarbonAds {
display: none;
}
}
</style>
6 changes: 6 additions & 0 deletions src/client/theme-default/components/VPDocAsideOutline.vue
Expand Up @@ -55,6 +55,12 @@ useActiveAnchor(container, marker)
display: block;
}

@media print {
.VPDocAsideOutline {
display: none;
}
}

.content {
position: relative;
border-left: 1px solid var(--vp-c-divider);
Expand Down
6 changes: 6 additions & 0 deletions src/client/theme-default/components/VPDocFooter.vue
Expand Up @@ -61,6 +61,12 @@ const showFooter = computed(() => {
margin-top: 64px;
}

@media print {
.VPDocFooter {
display: none;
}
}

.edit-info {
padding-bottom: 18px;
}
Expand Down
6 changes: 6 additions & 0 deletions src/client/theme-default/components/VPFooter.vue
Expand Up @@ -44,6 +44,12 @@ const { hasSidebar } = useSidebar()
}
}

@media print {
.VPFooter {
display: none;
}
}

.container {
margin: 0 auto;
max-width: var(--vp-layout-max-width);
Expand Down
6 changes: 6 additions & 0 deletions src/client/theme-default/components/VPLocalNav.vue
Expand Up @@ -114,6 +114,12 @@ const classes = computed(() => {
}
}

@media print {
.VPLocalNav {
display: none;
}
}

@media (min-width: 1440px) {
.VPLocalNav.has-sidebar {
padding-left: calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width));
Expand Down
12 changes: 11 additions & 1 deletion src/client/theme-default/components/VPNav.vue
Expand Up @@ -30,7 +30,7 @@ watchEffect(() => {
<template #nav-bar-content-before><slot name="nav-bar-content-before" /></template>
<template #nav-bar-content-after><slot name="nav-bar-content-after" /></template>
</VPNavBar>
<VPNavScreen :open="isScreenOpen">
<VPNavScreen :open="isScreenOpen" class="VPNavScreen">
<template #nav-screen-content-before><slot name="nav-screen-content-before" /></template>
<template #nav-screen-content-after><slot name="nav-screen-content-after" /></template>
</VPNavScreen>
Expand All @@ -54,4 +54,14 @@ watchEffect(() => {
position: fixed;
}
}

@media print {
.VPNav {
position: fixed;
}

.VPNavScreen {
display: none;
}
}
</style>
6 changes: 6 additions & 0 deletions src/client/theme-default/components/VPNavBar.vue
Expand Up @@ -177,6 +177,12 @@ watchPostEffect(() => {
}
}

@media print {
.content {
display: none;
}
}

.content-body {
display: flex;
justify-content: flex-end;
Expand Down
6 changes: 6 additions & 0 deletions src/client/theme-default/components/VPSidebar.vue
Expand Up @@ -105,6 +105,12 @@ watch(
}
}

@media print {
.VPSidebar {
display: none;
}
}

@media (min-width: 960px) {
.curtain {
position: sticky;
Expand Down