Skip to content

Commit 158f06f

Browse files
committed
Improve print
1 parent a295a81 commit 158f06f

8 files changed

Lines changed: 137 additions & 131 deletions

File tree

resources/js/Layouts/Layout.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,14 @@
248248
</template>
249249
<SidebarInset class="min-w-0">
250250
<header class="flex h-14 items-center gap-4 border-b backdrop-blur-sm bg-background/90 px-4 sticky top-0 z-40 lg:px-6
251-
transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12
251+
transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12 print:relative print:px-0 print:h-auto print:pb-4
252252
">
253253
<template v-if="auth()?.user">
254-
<SidebarTrigger class="-ml-1 shrink-0" />
254+
<SidebarTrigger class="-ml-1 shrink-0 print:hidden" />
255255
</template>
256+
<div class="text-sm hidden print:block font-semibold">
257+
{{ config('sharp.name') }}
258+
</div>
256259
<Separator
257260
orientation="vertical"
258261
class="mr-2 data-[orientation=vertical]:h-4"

resources/js/Pages/EntityList/EntityList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
</template>
8181

8282
<div class="@container">
83-
<div :class="entityList.pageAlert ? 'pt-4' : 'pt-6 @3xl:pt-10'">
83+
<div class="print:pt-0" :class="entityList.pageAlert ? 'pt-4' : 'pt-6 @3xl:pt-10'">
8484
<EntityListComponent
8585
:entity-key="entityKey"
8686
:entity-list="entityList"

resources/js/Pages/Show/Show.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135

136136
<WithCommands :commands="commands">
137137
<div class="@container">
138-
<div :class="show.pageAlert && !show.pageAlert.sectionKey ? 'pt-4' : 'pt-6 @3xl:pt-10'">
138+
<div class="print:pt-0" :class="show.pageAlert && !show.pageAlert.sectionKey ? 'pt-4' : 'pt-6 @3xl:pt-10'">
139139
<template v-if="show.pageAlert && !show.pageAlert.sectionKey">
140140
<div class="container">
141141
<PageAlert
@@ -145,7 +145,7 @@
145145
</div>
146146
</template>
147147

148-
<div class="grid gap-6 @3xl:gap-10">
148+
<div class="grid gap-6 @3xl:gap-10 print:gap-0">
149149
<template v-for="(section, i) in sectionsWithAlwaysFirst">
150150
<Section
151151
class="min-w-0"
@@ -227,7 +227,7 @@
227227
</template>
228228
</div>
229229
<template v-if="i == 0">
230-
<div class="ml-auto flex flex-wrap -my-1 justify-end gap-2"
230+
<div class="ml-auto flex flex-wrap -my-1 justify-end gap-2 print:hidden"
231231
:class="{ 'invisible': collapsed }"
232232
role="group"
233233
:aria-label="__('sharp::show.section_menu.aria_label', { title: show.getTitle(locale) })"

resources/js/components/StickyTop.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
</script>
4444

4545
<template>
46-
<div :style="{
46+
<div class="print:!relative print:!top-0"
47+
:style="{
4748
'--stacked-top': `${stackedTop}px`
4849
}"
4950
:data-stuck="stuck ? true : null"

resources/js/components/ui/RootCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div class="@container">
99
<div :class="[noPadding ? 'px-0' : '']">
1010
<div class="@container/root-card mx-auto px-0 max-w-348">
11-
<Card class="relative rounded-none border-x-0 *:px-4 @3xl:*:px-6 @[87rem]:border-x @[87rem]:rounded-lg" data-sticky-top-container>
11+
<Card class="relative rounded-none border-x-0 *:px-4 @3xl:*:px-6 print:*:px-0 @[87rem]:border-x @[87rem]:rounded-lg print:rounded-none print:border-x-0" data-sticky-top-container>
1212
<slot />
1313
</Card>
1414
</div>

resources/js/components/ui/RootCardHeader.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ defineProps<{
1212
<StickyTop class="group top-[calc(3.5rem-2px)] -mt-[2px] @[87rem]:-mx-px z-10 px-0!" :class="{
1313
'mb-1': !collapsed,
1414
}">
15-
<CardHeader class="px-4 @3xl:px-6 relative border-t group-data-stuck:rounded-none @[87rem]:border-x @[87rem]:rounded-t-lg group-data-[stuck]:shadow-b-md transition-shadow border-b-0 backdrop-blur-sm bg-card/90 backdrop-filter" :class="{ ' @[87rem]:rounded-b-lg': collapsed }">
15+
<CardHeader class="px-4 @3xl:px-6 relative border-t group-data-stuck:rounded-none @[87rem]:border-x @[87rem]:rounded-t-lg group-data-[stuck]:shadow-b-md transition-shadow border-b-0 backdrop-blur-sm bg-card/90 print:backdrop-blur-none print:px-0 print:rounded-none print:border-x-0" :class="{ ' @[87rem]:rounded-b-lg': collapsed }">
1616
<slot />
1717
</CardHeader>
1818
</StickyTop>

resources/js/components/ui/sidebar/Sidebar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const { isMobile, state, openMobile, setOpenMobile } = useSidebar()
4949
</Sheet>
5050

5151
<div
52-
v-else class="group peer hidden md:block"
52+
v-else class="group peer hidden md:block print:hidden"
5353
:data-state="state"
5454
:data-collapsible="state === 'collapsed' ? collapsible : ''"
5555
:data-variant="variant"

0 commit comments

Comments
 (0)