diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-10-02 12:19:21 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-10-06 09:45:06 +0200 |
commit | 23a46b0597635e098dc3a375765ddb25ac9d0c05 (patch) | |
tree | e0d366acadbb422a465196a113345d56ce3f5864 /theme/stylesheets | |
parent | 51c79f294ca8ef9bc3205a7c81454d7a3fd2722c (diff) | |
download | gitbook-23a46b0597635e098dc3a375765ddb25ac9d0c05.zip gitbook-23a46b0597635e098dc3a375765ddb25ac9d0c05.tar.gz gitbook-23a46b0597635e098dc3a375765ddb25ac9d0c05.tar.bz2 |
Remove margin on first header of a page (ebook)
Avoid breaking in code blocks
Diffstat (limited to 'theme/stylesheets')
-rwxr-xr-x | theme/stylesheets/ebook.less | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/theme/stylesheets/ebook.less b/theme/stylesheets/ebook.less index f167fd0..01a7d42 100755 --- a/theme/stylesheets/ebook.less +++ b/theme/stylesheets/ebook.less @@ -7,6 +7,42 @@ body { font-family: sans-serif; .markdown-content(#000, 1.6); + pre, code, blockquote { + page-break-inside: avoid; + } + + tr, img { + page-break-inside: avoid; + } + + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + + + h1, + h2, + h3 { + page-break-before: initial; + page-break-after: avoid; + } + + // Section and first titles + .section { + > h1, > h2, > h3 { + margin-top: 0px; + } + } + + // Hide the title (only used to build PDF table of content) + .book-chapter { + display: none; + } + + // First page: table of contents &.page-toc { .glossary { margin-bottom: 40px; @@ -31,9 +67,5 @@ body { } } } - - .book-chapter { - display: none; - } } } |