From cdb24abeb2514b0eab96defbb13b5e64e5223139 Mon Sep 17 00:00:00 2001 From: Michael Schmidt Date: Mon, 28 Dec 2020 19:25:05 +0100 Subject: [PATCH] Line Highlight: Fixed print background color (#2668) --- plugins/line-highlight/prism-line-highlight.css | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/line-highlight/prism-line-highlight.css b/plugins/line-highlight/prism-line-highlight.css index 1262b9a342..ae47c89a28 100644 --- a/plugins/line-highlight/prism-line-highlight.css +++ b/plugins/line-highlight/prism-line-highlight.css @@ -19,6 +19,17 @@ pre[data-line] { white-space: pre; } +@media print { + .line-highlight { + /* + * This will prevent browsers from replacing the background color with white. + * It's necessary because the element is layered on top of the displayed code. + */ + -webkit-print-color-adjust: exact; + color-adjust: exact; + } +} + .line-highlight:before, .line-highlight[data-end]:after { content: attr(data-start);