Usually, when writing print CSS, you would want to omit background-color declarations to improve readability (and save ink).

I had a case at work today though where I actually needed them to print. It was used in some progress indicators that didn’t make any sense without it. But some browsers ignore background-color by default in print, unless the user selects otherwise.

If you absolutely have to override that, there’s -webkit-print-color-adjust: exact.
It only works in Chrome and Safari though.

-webkit-print-color-adjust on MDN

  • 0
  • 0

No mentions yet.