I have some simple CSS:
#someElement {
background-color:black;
color:white;
}
It looks ok in the browser, but when I go to print it
This is how I made it to work in my case by adding the below two lines to the particular div. "@@supports (-moz-appearance:meterbar)" is helpful to add styles specific to Firefox.
-webkit-print-color-adjust: exact; color-adjust: exact;
@@supports (-moz-appearance:meterbar) {
.container {
margin: 0;
font-size: 0.85em;
width: 100%;
-webkit-print-color-adjust: exact;
color-adjust: exact;
}
}