Skip to content

Instantly share code, notes, and snippets.

@Digiman
Last active October 12, 2015 23:58
Show Gist options
  • Save Digiman/4107078 to your computer and use it in GitHub Desktop.
Save Digiman/4107078 to your computer and use it in GitHub Desktop.
Prepare the page to print.
@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: "";
}
}
Display the source blob
Display the rendered blob
Raw
<!-- SVG version of grayscale filter: desaturate.svg -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg">
<filter id="grayscale">
<feColorMatrix type="matrix" values="0.3333 0.3333 0.3333 0 0
0.3333 0.3333 0.3333 0 0
0.3333 0.3333 0.3333 0 0
0 0 0 1 0"/>
</filter>
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment