Skip to content

Commit e7f8494

Browse files
committed
Service page fixes for print media
1 parent 881ac76 commit e7f8494

7 files changed

Lines changed: 54 additions & 7 deletions

File tree

src/components/Callout/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const iconColor = accentTextClasses.startsWith('text-') ? accentTextClasses.slic
9393
]}
9494
role="note"
9595
>
96-
<div class="flex items-center gap-2">
96+
<div class="callout__header flex items-center gap-2">
9797
<div
9898
class:list={[
9999
accentTextClasses,

src/components/Code/CodeTabs/client/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export class CodeTabsElement extends LitElement {
131131
private buildUi(args: { shouldRenderTabs: boolean; labels: string[] }): void {
132132
const header = document.createElement('div')
133133
header.className =
134-
'flex w-full min-w-0 items-center justify-between bg-page-offset'
134+
'code-tabs-print-header flex w-full min-w-0 items-center justify-between bg-page-offset'
135135

136136
const copyButton = this.createCopyButton()
137137

src/components/Pages/About/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const expertiseIcons = ['cloud', 'document', 'gear', 'globe', 'wrench', 'chart']
8989
<h3 class="text-page-inverse mb-2">{item.title}</h3>
9090
<p class="text-content leading-relaxed">{item.description}</p>
9191
{index === 0 && (
92-
<div class="mt-3 flex justify-end">
92+
<div class="mt-3 flex justify-end print:hidden!">
9393
<Button
9494
text="View C.V."
9595
variant="page-inverse"

src/components/Pages/Services/index.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const splitH2Sections = (html: string): string[] => {
9595
<article
9696
data-service-card
9797
class:list={[
98-
'relative flex flex-col rounded-2xl border border-trim overflow-hidden transition-shadow hover:shadow-lg focus-within:shadow-lg',
98+
'service-card relative flex flex-col rounded-2xl border border-trim overflow-hidden transition-shadow hover:shadow-lg focus-within:shadow-lg',
9999
i === 0 ? 'service-card--default' : '',
100100
]}
101101
>
@@ -131,7 +131,7 @@ const splitH2Sections = (html: string): string[] => {
131131
</p>
132132
</div>
133133

134-
<div class="flex flex-1 flex-col bg-content-inverse px-6 py-6">
134+
<div class="service-card-body flex flex-1 flex-col bg-content-inverse px-6 py-6">
135135
<div class="grid gap-6 md:grid-cols-2">
136136
<div class="space-y-6 [&_h2]:text-sm [&_h2]:font-semibold [&_h2]:uppercase [&_h2]:tracking-wider [&_h2]:text-page-inverse [&_h2]:mb-2 [&_h2]:mt-0 [&_p]:text-content [&_p]:text-sm [&_p]:leading-relaxed [&_ul]:space-y-1.5 [&_ul]:text-sm [&_ul]:text-content [&_ul]:list-none [&_ul]:pl-0 [&_li]:flex [&_li]:items-start [&_li]:gap-2 [&_li]:before:content-['✓'] [&_li]:before:text-success [&_li]:before:mt-0.5 [&_li]:before:shrink-0">
137137
<Fragment set:html={leftSections} />

src/pages/articles/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const path = '/articles'
3737
path={path}
3838
icon="paper-and-pen"
3939
>
40-
<div class="pb-0">
40+
<div class="pb-0 print:hidden!">
4141
<div class="space-y-12">
4242
{
4343
tagsWithContent

src/pages/case-studies/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const path = '/case-studies'
3535
icon="folder-magnifying-glass"
3636
>
3737
<section
38-
class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 lg:gap-12"
38+
class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 lg:gap-12 print:hidden!"
3939
aria-label="Case studies"
4040
>
4141
{

src/styles/print.css

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,44 @@
124124
break-inside: avoid;
125125
}
126126

127+
.callout {
128+
box-decoration-break: slice;
129+
break-inside: avoid;
130+
display: block !important;
131+
overflow: visible !important;
132+
}
133+
134+
.callout__header {
135+
break-after: avoid;
136+
}
137+
138+
.callout__content {
139+
break-before: avoid;
140+
}
141+
142+
.callout__header + .callout__content {
143+
margin-top: 0.75rem;
144+
}
145+
146+
.service-card {
147+
background-clip: padding-box;
148+
background-color: var(--color-content-inverse) !important;
149+
border: 1px solid var(--color-trim) !important;
150+
border-radius: 1rem !important;
151+
box-decoration-break: clone;
152+
overflow: visible !important;
153+
}
154+
155+
.service-card-body {
156+
background-color: var(--color-content-inverse) !important;
157+
padding-bottom: 2rem !important;
158+
}
159+
160+
.services-grid {
161+
background-color: var(--color-page-base) !important;
162+
row-gap: 3rem !important;
163+
}
164+
127165
/**
128166
* Make sure Zebra List doesn't leave an empty container with borders
129167
* when it breaks across lines
@@ -233,10 +271,19 @@
233271
display: none !important;
234272
}
235273

274+
.code-tabs-print-header + pre,
275+
.code-tabs-print-header + [role="tabpanel"] {
276+
break-before: avoid;
277+
}
278+
236279
code-tabs [role="tabpanel"]:first-of-type {
237280
display: block !important;
238281
}
239282

283+
.code-tabs-print-header {
284+
break-after: avoid;
285+
}
286+
240287
/* Hide copy buttons inside code blocks */
241288
code-tabs button {
242289
display: none !important;

0 commit comments

Comments
 (0)