Skip to content

Instantly share code, notes, and snippets.

@uxDaniel
Last active August 29, 2015 14:22
Show Gist options
  • Save uxDaniel/3338c35caec7fbf18405 to your computer and use it in GitHub Desktop.
Save uxDaniel/3338c35caec7fbf18405 to your computer and use it in GitHub Desktop.
Styles for printing correctly the book "Learning JavaScript Design Patterns" by Addy Osmani
/*
Styles for printing correctly the book
"Learning JavaScript Design Patterns" by Addy Osmani
http://addyosmani.com/resources/essentialjsdesignpatterns/book/
*/
@media print {
/* resets */
body {
background: none;
}
ol > ol {
padding-left: 0;
}
.container {
width: 100%;
margin: 0;
max-width: 100%;
padding: 0;
box-shadow: none;
}
#contents-list {
border: none;
padding: 0;
}
/* hide some elements */
#reviews,
.twitter-tweet-button,
.codecodecode,
.toolbar {
display: none;
}
/* page breaks */
h1, h2 {
page-break-before: always;
}
h1.booktitle, h2.booktitle, h2 + h2 {
page-break-before: auto;
}
.syntaxhighlighter {
page-break-inside: avoid;
}
/* other improvements */
.syntaxhighlighter {
font-size: 13px !important;
}
.alert-message {
background-color: #ffffaa;
padding: 10px;
border: 2px solid #ffff00;
text-align: justify;
}
p, li, td {
text-align: justify;
}
#references-list a {
display: block;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment