diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-08-11 08:38:11 -0700 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-08-11 08:38:11 -0700 |
commit | 3a54554713949d466d81fe196e204d78347186d9 (patch) | |
tree | e8d861c82b6dd56948419302b8122e3fd842b1d3 /theme/stylesheets | |
parent | fc113ce0c3607cc8e9cd6de4b08baba0bbf433cd (diff) | |
download | gitbook-3a54554713949d466d81fe196e204d78347186d9.zip gitbook-3a54554713949d466d81fe196e204d78347186d9.tar.gz gitbook-3a54554713949d466d81fe196e204d78347186d9.tar.bz2 |
Normalize markdown rendering with ebook (pdf, epub, mobi)
Diffstat (limited to 'theme/stylesheets')
-rw-r--r--[-rwxr-xr-x] | theme/stylesheets/base/markdown.less (renamed from theme/stylesheets/website/markdown.less) | 67 | ||||
-rwxr-xr-x | theme/stylesheets/ebook.less | 20 | ||||
-rwxr-xr-x | theme/stylesheets/mixins.less | 2 |
3 files changed, 12 insertions, 77 deletions
diff --git a/theme/stylesheets/website/markdown.less b/theme/stylesheets/base/markdown.less index 8c4f634..46d6953 100755..100644 --- a/theme/stylesheets/website/markdown.less +++ b/theme/stylesheets/base/markdown.less @@ -1,14 +1,10 @@ -.book .book-body .page-wrapper .page-inner section { - display: none; -} - -.book .book-body .page-wrapper .page-inner section.normal { +.markdown-content(@md-color, @md-line-height) { -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; line-height: 1.4; - color: @content-color; + color: @md-color; overflow: hidden; - line-height: @content-line-height; + line-height: @md-line-height; word-wrap: break-word; display: block; @@ -325,6 +321,7 @@ max-width: 100%; -moz-box-sizing: border-box; box-sizing: border-box; + page-break-inside: avoid; } code { @@ -390,59 +387,3 @@ background: #ffffff; } } - -.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal { - color:@page-color-1; - - pre, code { - background: #fdf6e3; - color: #657b83; - border-color: darken(#fdf6e3, 15%); - - @import "./highlight/sepia.less"; - } - - table { - th, td { - border-color: darken(#fdf6e3, 25%); - } - - tr { - background: #fdf6e3; - color: inherit; - border-color: #444; - } - - tr:nth-child(2n) { - background-color: darken(#fdf6e3, 5%); - } - } -} - -.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal { - color:@page-color-2; - - pre, code { - background: black; - color: #eaeaea; - border-color: #000; - - @import "./highlight/night.less"; - } - - table { - th, td { - border-color: #444; - } - - tr { - background-color: black; - color: #eaeaea; - border-color: #444; - } - - tr:nth-child(2n) { - background-color: #222; - } - } -} diff --git a/theme/stylesheets/ebook.less b/theme/stylesheets/ebook.less index 154c3bf..50ab459 100755 --- a/theme/stylesheets/ebook.less +++ b/theme/stylesheets/ebook.less @@ -7,20 +7,6 @@ display: none; } - -pre, blockquote { - border: 1px solid #999; - page-break-inside: avoid; - background: #f1f1f1; - padding: 8px; -} - -img { - max-width: 100% !important; - page-break-inside: avoid; - margin: 0px auto; -} - .exercise, .quiz { margin: 1cm 0cm; padding: 0.4cm; @@ -38,3 +24,9 @@ img { margin-top: 0.4cm; } } + + +body { + font-family: sans-serif; + .markdown-content(#333, 1.6); +} diff --git a/theme/stylesheets/mixins.less b/theme/stylesheets/mixins.less index 0ee4ebb..9d28305 100755 --- a/theme/stylesheets/mixins.less +++ b/theme/stylesheets/mixins.less @@ -1,3 +1,5 @@ +@import "base/markdown.less"; + .link-inherit { color: inherit; |