generated from nhcarrigan/template
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user