Skip to content

Commit 4266f5e

Browse files
authored
copilot generated: add media queries for print view (microsoft#11110)
1 parent cd39847 commit 4266f5e

3 files changed

Lines changed: 61 additions & 0 deletions

File tree

‎teachertool/src/components/styling/CriteriaInstanceDisplay.module.scss‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
align-items: flex-start;
55
width: 100%;
66

7+
@media print {
8+
page-break-inside: avoid;
9+
}
10+
711
div[class*="common-input-group"] {
812
border-radius: 0.5rem;
913
border: solid 1px var(--pxt-neutral-foreground1);
@@ -177,6 +181,11 @@
177181
width: 100%; // For non-webkit browsers
178182
width: -webkit-fill-available; // Webkit browsers
179183

184+
@media print {
185+
width: 100%;
186+
color: #333333;
187+
}
188+
180189
&.for-print {
181190
font-style: italic;
182191
}

‎teachertool/src/components/styling/EvalResultDisplay.module.scss‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
padding: 1rem;
44
overflow: auto;
55
container-type: inline-size;
6+
7+
@media print {
8+
height: auto;
9+
overflow: visible;
10+
container-type: normal;
11+
padding: 0.5rem;
12+
}
613
}
714

815
.checklist-control-tray {
@@ -83,6 +90,12 @@
8390
width: 100%; // For non-webkit browsers
8491
width: -webkit-fill-available; // Webkit browsers
8592
padding: 0.5rem;
93+
94+
@media print {
95+
width: 100%;
96+
padding: 0;
97+
page-break-inside: avoid;
98+
}
8699
}
87100

88101
.specific-criteria-result {
@@ -95,6 +108,12 @@
95108
min-height: 9rem;
96109
gap: 0.5rem;
97110

111+
@media print {
112+
width: 100%;
113+
min-height: unset;
114+
page-break-inside: avoid;
115+
}
116+
98117
.loading-display {
99118
padding-top: 0;
100119
flex-grow: 1;
@@ -167,6 +186,11 @@
167186
margin-top: 0.5rem;
168187
width: 100%; // For non-webkit browsers
169188
width: -webkit-fill-available; // Webkit browsers
189+
190+
@media print {
191+
width: 100%;
192+
border-bottom-color: #000000;
193+
}
170194
}
171195

172196
.result-details {
@@ -178,6 +202,11 @@
178202
height: 50%;
179203
gap: 0.5rem;
180204

205+
@media print {
206+
height: auto;
207+
page-break-inside: avoid;
208+
}
209+
181210
.display-string {
182211
font-weight: 500;
183212
padding-right: 0.5rem;
@@ -220,6 +249,11 @@
220249
min-height: 5.5rem;
221250
gap: 0.5rem;
222251

252+
@media print {
253+
min-height: unset;
254+
page-break-inside: avoid;
255+
}
256+
223257
.notes-container {
224258
width: 100%;
225259
max-width: 100%;
@@ -258,6 +292,11 @@
258292
justify-content: space-between;
259293
padding: 0.5rem 0;
260294

295+
@media print {
296+
page-break-after: avoid;
297+
page-break-inside: avoid;
298+
}
299+
261300
.checklist-name {
262301
display: flex;
263302
flex-direction: row;

‎teachertool/src/global.scss‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,19 @@ code {
129129
break-before: avoid;
130130
}
131131

132+
// Ensure body and html don't constrain the print layout
133+
html, body {
134+
height: auto !important;
135+
overflow: visible !important;
136+
}
137+
138+
// Fix for webkit browsers (Safari)
139+
body {
140+
width: 100% !important;
141+
margin: 0 !important;
142+
padding: 0 !important;
143+
}
144+
132145
.no-print {
133146
display: none !important;
134147
}

0 commit comments

Comments
 (0)