fix: restore print media query functionality

Removes CDN global styles before printing via beforeprint/afterprint
events, preventing the witchy theme from bleeding into print output.
Fixes print layout: centred name and contact info, reset margins for
compact sub-position lists, and footer z-index for screen view.
This commit is contained in:
2026-04-20 12:10:18 -07:00
committed by Naomi Carrigan
parent 8ed53738e0
commit 7b8cda989b
2 changed files with 22 additions and 0 deletions
+10
View File
@@ -28,6 +28,16 @@ const htmlBeginning = `<!DOCTYPE html>
const htmlEnd = ` </main>
</body>
<script src="./dates.js"></script>
<script>
var _cdnStyle = null;
window.addEventListener("beforeprint", function() {
_cdnStyle = document.getElementById("nhcarrigan-global-styles");
if (_cdnStyle) { _cdnStyle.remove(); }
});
window.addEventListener("afterprint", function() {
if (_cdnStyle) { document.head.appendChild(_cdnStyle); _cdnStyle = null; }
});
</script>
</html>`;
const request = await fetch(