KNACSS/sass/_print.scss
2013-07-09 14:01:24 +02:00

97 lines
No EOL
1.6 KiB
SCSS

/* ----------------------------- */
/* ==print */
/* ----------------------------- */
@media print {
* {
background: transparent !important;
box-shadow: none !important;
text-shadow: none !important;
}
body {
width: auto !important;
margin: auto !important;
font-family: serif;
font-size: 12pt;
background-color: #fff !important;
color: #000 !important;
}
h1, h2, h3, h4, h5, h6,
p, blockquote,
ul, ol {
color: #000 !important;
margin: auto !important;
}
/**
* Displays possible .print elements
*/
.print {
display: block;
}
/**
* Try turning images to black and white if supported filters
*/
img {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
}
/**
* 1. No orphans
* 2. No widows
*/
p,
blockquote {
orphans: 3; /* 1 */
widows: 3; /* 2 */
}
/**
* Prevents breaks inside these elements
*/
blockquote,
ul, ol {
page-break-inside: avoid;
}
/**
* Forces page break before main headers
*/
h1 {
page-break-before: always;
}
/**
* Prevents breaks after these elements
*/
h1, h2, h3,
caption {
page-break-after: avoid;
}
/**
* 1. Displays url after link
* 2. ... unless it's a JS or empty link
*/
a {
color: #000 !important;
text-decoration: underline !important;
&[href]:after {
content: " (" attr(href) ")"; /* 1 */
}
&[href^="javascript:"]:after,
&[href^="#"]:after,
&[href=""] {
content: ''; /* 2 */
}
}
}