Skip to content

Instantly share code, notes, and snippets.

@carlos-sanchez
Created November 14, 2013 03:59
Show Gist options
  • Save carlos-sanchez/7461129 to your computer and use it in GitHub Desktop.
Save carlos-sanchez/7461129 to your computer and use it in GitHub Desktop.
Print. Okay, there are many things to note here. Let’s start with the color stuff. You have probably understood the point of turning everything into black and white: saving money. Do you know how much a color ink cartridge costs? :D The first four lines take care of 75% of the job by turning the font color to black and removing backgrounds and s…
@media print {
* {
background: none !important;
color: black !important;
box-shadow: none !important;
text-shadow: none !important;
/* Images, vectors and such */
filter: Gray(); /* IE4-8: depreciated */
filter: url('desaturate.svg#grayscale'); /* SVG version for IE10, Firefox, Safari 5 and Opera */
-webkit-filter: grayscale(100%); /* Chrome + Safari 6 */
-moz-filter: grayscale(100%); /* Future proof */
-ms-filter: grayscale(100%); /* Future proof */
-o-filter: grayscale(100%); /* Future proof */
filter: grayscale(100%); /* Future proof or polyfilled */
}
a {
text-decoration: underline;
}
a[href]:after {
content: " (" attr(href) ")";
}
a[href="#"],
a[href="javascript:"] {
content: "";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment