/* ----------------------------- */ /* ==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: #333 !important; } h1, h2, h3, h4, h5, h6, p, blockquote, ul, ol { color: #000 !important; margin: auto !important; } /** * Displays possible .print elements */ .print { display: block; } img { @include 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 { content: ''; /* 2 */ } } }