diff --git a/src/theme/book.css b/src/theme/book.css index c52cc004..14cfc865 100644 --- a/src/theme/book.css +++ b/src/theme/book.css @@ -264,15 +264,11 @@ table thead td { line-height: 25px; white-space: nowrap; } -.theme-popup .theme:hover:first-child { +.theme-popup .theme:hover:first-child, +.theme-popup .theme:hover:last-child { border-top-left-radius: inherit; border-top-right-radius: inherit; } -.theme-popup .theme:hover:last-child { - border-bottom-left-radius: inherit; - border-bottom-right-radius: inherit; -} - @media only screen and (max-width: 1250px) { .nav-chapters { display: none; @@ -765,9 +761,11 @@ table thead td { .rust pre > .result { margin-top: 10px; } - -@media print { - #sidebar { +@media only print { + #sidebar, + #menu-bar, + .nav-chapters, + .mobile-nav-chapters { display: none; } #page-wrapper { @@ -779,16 +777,40 @@ table thead td { margin: 0; padding: 0; } - #menu-bar { - display: none; - } .page { overflow-y: initial; } - .nav-chapters { - display: none; + code { + background-color: #666; + -webkit-border-radius: 5px; + border-radius: 5px; +/* Force background to be printed in Chrome */ + -webkit-print-color-adjust: exact; } - .mobile-nav-chapters { - display: none; + a, + a:visited, + a:active, + a:hover { + color: #4183c4; + text-decoration: none; + } + h1, + h2, + h3, + h4, + h5, + h6 { + page-break-inside: avoid; + page-break-after: avoid; +/*break-after: avoid*/ + } + pre, + code { + page-break-inside: avoid; + white-space: pre-wrap /* CSS 3 */; + white-space: -moz-pre-wrap /* Mozilla, since 1999 */; + white-space: -pre-wrap /* Opera 4-6 */; + white-space: -o-pre-wrap /* Opera 7 */; + word-wrap: break-word /* Internet Explorer 5.5+ */; } } diff --git a/src/theme/stylus/book.styl b/src/theme/stylus/book.styl index f8eaaaf0..c51497d0 100644 --- a/src/theme/stylus/book.styl +++ b/src/theme/stylus/book.styl @@ -7,3 +7,4 @@ @import 'nav-icons' @import 'theme-popup' @import 'themes' +@import 'print'