KNACSS/sass/print.scss

89 lines
1.4 KiB
SCSS
Raw Normal View History

2013-04-04 21:29:49 +02:00
/* ----------------------------- */
/* ==print */
/* ----------------------------- */
@media print {
2013-04-06 17:38:36 +02:00
* {
background: transparent !important;
box-shadow: none !important;
text-shadow: none !important;
}
2013-04-04 21:29:49 +02:00
body {
2013-04-06 17:38:36 +02:00
width: auto !important;
margin: auto !important;
2013-04-04 21:29:49 +02:00
font-family: serif;
font-size: 12pt;
2013-04-06 17:38:36 +02:00
background-color: #fff !important;
color: #333 !important;
2013-04-04 21:29:49 +02:00
}
2013-04-06 17:38:36 +02:00
h1, h2, h3, h4, h5, h6,
p, blockquote,
2013-04-04 21:29:49 +02:00
ul, ol {
2013-04-06 17:38:36 +02:00
color: #000 !important;
margin: auto !important;
2013-04-04 21:29:49 +02:00
}
/**
* Displays possible .print elements
*/
.print {
display: block;
}
2013-04-06 17:38:36 +02:00
img {
@include filter(grayscale(100%));
}
2013-04-04 21:29:49 +02:00
/**
* 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
2013-04-06 17:38:36 +02:00
* 2. ... unless it's a JS or empty link
2013-04-04 21:29:49 +02:00
*/
a {
color: #000 !important;
text-decoration: underline !important;
&[href]:after {
content: " (" attr(href) ")"; /* 1 */
}
2013-04-06 17:38:36 +02:00
&[href^="javascript:"]:after,
&[href^="#"]:after {
content: ''; /* 2 */
}
2013-04-04 21:29:49 +02:00
}
}