0

Alright, I use npm to install bootstrap. The website should be printable, so the basic bootstrap print style is nice. But I need the text colors. Sadly the default bootstrap removes all colors.

*,
*:before,
*:after {
    color: #000 !important; // Black prints faster: h5bp.com/s
}

I want to "revert" that color setting, but don't want to / can't change the bootstrap files as they are deployed and installed on rollout.

Has anyone an idea how to overwrite that setting with a custom css?

  • just declare a new statement after the you loaded the bootstrap file? That overwrites the value, without changing the original file – Xorifelse Jan 10 '17 at 14:08

2 Answers2

0

I had to add:

-webkit-print-color-adjust: exact; 

to fix color problems with my style sheets...

0

You should be able to declare an identical selector to override it, presuming your custom CSS is loaded after Bootstrap's.

i.e.

*,
*:before,
*:after {
    color: /* some other color /*
}
Mike
  • 15
  • 1
  • 3
  • Yes, that's right, but I want to have it to the original color. So if a text was green, it should be green on the print page, if it was red ... But it looks like I have to rewrite the color styles for the print page. – Kim Schneider Jan 11 '17 at 07:44
  • 1
    Ah, misunderstood the ask there Kim. From this answer [here](http://stackoverflow.com/questions/33410724/bootstrap-print-css-removes-background-color) and my own knowledge, you'll have to rewrite them if you can't customize your Bootstrap at all. That's unfortunate since the Bootstrap site does let you download a custom build that excludes the print styles. – Mike Jan 11 '17 at 19:59