-
I really like the Can I somehow override this in CSS? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
It appears to be an open issue in the CSS Working Group: w3c/csswg-drafts#2084 . Hopefully the next big iteration of web browsers supports it. |
Beta Was this translation helpful? Give feedback.
-
I've come up with the JS script below that will expand spoilers for printing and revert them after printing. Usage: Save the JS below as let expandedSpoilers = [];
window.addEventListener("beforeprint", () => {
expandedSpoilers = [];
for (const spoiler of document.querySelectorAll(".spoiler a[aria-expanded=false]")) {
expandedSpoilers.push(spoiler);
spoiler.click();
};
});
window.addEventListener("afterprint", () => {
for (const spoiler of expandedSpoilers) {
spoiler.click();
}
expandedSpoilers = [];
}); |
Beta Was this translation helpful? Give feedback.
I've come up with the JS script below that will expand spoilers for printing and revert them after printing.
Usage: Save the JS below as
assets/js/print-spoiler-contents.js
; create thejs
directory if non-existing. Inconfig/_default/params.toml
, locate theplugins_js
setting and addprint-spoiler-contents
to it; e.g. to getplugins_js = ["print-spoiler-contents"]
.