Skip to content

Commit cdb24ab

Browse files
Line Highlight: Fixed print background color (#2668)
1 parent e644178 commit cdb24ab

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

plugins/line-highlight/prism-line-highlight.css

+11
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ pre[data-line] {
1919
white-space: pre;
2020
}
2121

22+
@media print {
23+
.line-highlight {
24+
/*
25+
* This will prevent browsers from replacing the background color with white.
26+
* It's necessary because the element is layered on top of the displayed code.
27+
*/
28+
-webkit-print-color-adjust: exact;
29+
color-adjust: exact;
30+
}
31+
}
32+
2233
.line-highlight:before,
2334
.line-highlight[data-end]:after {
2435
content: attr(data-start);

0 commit comments

Comments
 (0)