File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { siteInfo } from "#constants/site-info";
88import " ../styles/base.css" ;
99import " ../styles/reset.css" ;
1010import " ../styles/theme.css" ;
11+ import " ../styles/print.css" ;
1112
1213export interface Props {
1314 title: string ;
@@ -86,5 +87,13 @@ const pageTitle = Astro.url.pathname === "/" ? title : `${title} · Namesake`;
8687 <slot />
8788 </main >
8889 <Footer />
90+ <script >
91+ // Print media lazy-loading bypass
92+ window.addEventListener('beforeprint', () => {
93+ document.querySelectorAll('img[loading]').forEach(img => {
94+ img.removeAttribute('loading');
95+ });
96+ });
97+ </script >
8998 </body >
9099</html >
Original file line number Diff line number Diff line change 1+ /* These styles are only used when printing the page. */
2+ /* biome-ignore-all lint/complexity/noImportantStyles: print styles should always override site styles */
3+
4+ @media print {
5+ html ,
6+ body {
7+ background-color : none;
8+ }
9+
10+ body > * : not (main ) {
11+ display : none !important ;
12+ }
13+
14+ body ::before ,
15+ body ::after {
16+ display : none;
17+ }
18+
19+ .rough-annotation {
20+ display : none; /* Would display in odd location due to loading delay. */
21+ }
22+
23+ details ::details-content {
24+ height : auto !important ;
25+ content-visibility : visible !important ;
26+ opacity : 1 !important ;
27+ }
28+
29+ a [href ]: not ([href ^= "#" ])::after {
30+ content : " (" attr (href) ")" ;
31+ }
32+
33+ abbr [title ]::after {
34+ content : " (" attr (title) ")" ;
35+ }
36+ }
You can’t perform that action at this time.
0 commit comments