|
| 1 | +/* @page is for EPUB2 only */ |
| 2 | +@page { |
| 3 | + margin: 0; |
| 4 | +} |
| 5 | + |
| 6 | +body.calibre-desktop { |
| 7 | + padding: 20pt 0 !important; |
| 8 | +} |
| 9 | + |
| 10 | +body.calibre-desktop > section { |
| 11 | + margin: 0 25pt; |
| 12 | +} |
| 13 | + |
| 14 | +/* Gitden & Namo default to 16px font-size; bump it to 19px (118.75%) */ |
| 15 | +body.gitden-reader, |
| 16 | +body.namo-epub-library { |
| 17 | + font-size: 118.75%; |
| 18 | +} |
| 19 | + |
| 20 | +/* Gitden doesn't give us much margin, so let's roughly match Aldiko and Kindle (narrow setting) */ |
| 21 | +body.gitden-reader { |
| 22 | + margin: 0 5pt !important; |
| 23 | +} |
| 24 | + |
| 25 | +/* Namo has the same margin problem, except setting side margins doesn't work */ |
| 26 | +/*body.namo-epub-library > section.chapter { |
| 27 | + margin: 0 5pt; |
| 28 | +}*/ |
| 29 | + |
| 30 | +/* Use tighter margins and smaller font (18px) on phones (Nexus 4 and smaller) */ |
| 31 | +@media only screen and (max-device-width: 768px) and (max-device-height: 1280px), |
| 32 | +only screen and (max-device-width: 1280px) and (max-device-height: 768px) { |
| 33 | + body.gitden-reader, |
| 34 | + body.namo-epub-library { |
| 35 | + font-size: 112.5%; |
| 36 | + } |
| 37 | + |
| 38 | + /*body.gitden-reader { |
| 39 | + margin: 0 5pt !important; |
| 40 | + }*/ |
| 41 | + |
| 42 | + /*body.namo-epub-library > section.chapter { |
| 43 | + margin: 0 5pt; |
| 44 | + }*/ |
| 45 | +} |
| 46 | + |
| 47 | +body.gitden-reader pre { |
| 48 | + white-space: pre-wrap !important; /* Gitden must be applying white-space: pre !important */ |
| 49 | +} |
| 50 | + |
| 51 | +body h1, body h2, body h3:not(.list-heading), body h4, body h5, body h6, |
| 52 | +h1 :not(code), h2 :not(code), h3:not(.list-heading) :not(code), h4 :not(code), h5 :not(code), h6 :not(code) { |
| 53 | + /* !important required to override custom font setting in Kindle / Gitden / Namo */ |
| 54 | + /* Gitden requires the extra weight of a parent selector; it also makes headings bold when custom font is specified */ |
| 55 | + /* Kindle and Gitden require the override on heading child elements */ |
| 56 | + font-family: "M+ 1p", sans-serif !important; |
| 57 | +} |
| 58 | + |
| 59 | +/* QUESTION what about nested elements inside code? */ |
| 60 | +body code, body kbd, body pre, pre :not(code) { |
| 61 | + /* !important required to override custom font setting in Kindle / Gitden / Namo */ |
| 62 | + /* Gitden requires the extra weight of a parent selector */ |
| 63 | + /* Kindle and Gitden require the override on pre child elements */ |
| 64 | + font-family: "M+ 1mn", monospace !important; |
| 65 | +} |
| 66 | + |
| 67 | +@media amzn-kf8 { |
| 68 | + /* Kindle does its own margin management, so don't use an explicit margin */ |
| 69 | + /*body { |
| 70 | + margin: 0 !important; |
| 71 | + }*/ |
| 72 | + |
| 73 | + /* text-rendering is the only way to enable kerning in Kindle (and Calibre, though it seems to kern automatically) */ |
| 74 | + /* personally, I think Kindle overdoes kerning, but we're running with it for now */ |
| 75 | + /* text-rendering: optimizeLegibility kills certain Kindle eInk devices */ |
| 76 | + /*h1, h2, h3, h4, h5, h6, |
| 77 | + body p, li, dd, blockquote > footer, |
| 78 | + th, td, figcaption, caption { |
| 79 | + text-rendering: optimizeLegibility; |
| 80 | + }*/ |
| 81 | + |
| 82 | + /* hack line height of subtitle using floats on Kindle */ |
| 83 | + h1.chapter-title .subtitle { |
| 84 | + margin-top: -0.2em; |
| 85 | + margin-bottom: 0.3em; /* compensate for reduced line height */ |
| 86 | + } |
| 87 | + |
| 88 | + /* NOTE using b instead of span since Firefox ePubReader applies immutable styles to span */ |
| 89 | + h1.chapter-title .subtitle > b { |
| 90 | + float: left; |
| 91 | + display: inline-block; |
| 92 | + margin-bottom: -0.3em; /* reduce the line height */ |
| 93 | + padding-right: 0.2em; /* spacing between words */ |
| 94 | + } |
| 95 | + |
| 96 | + h1.chapter-title .subtitle > b:last-child { |
| 97 | + padding-right: 0; |
| 98 | + } |
| 99 | + |
| 100 | + h1.chapter-title .subtitle::after { |
| 101 | + display: table; |
| 102 | + content: ' '; |
| 103 | + clear: both; |
| 104 | + } |
| 105 | +} |
| 106 | + |
| 107 | +/* Use darker font colors on Kindle Paperwhite */ |
| 108 | +@media amzn-kf8 and (device-height: 1024px) and (device-width: 758px), |
| 109 | + amzn-kf8 and (device-height: 758px) and (device-width: 1024px) { |
| 110 | + body p, |
| 111 | + div.abstract > p, |
| 112 | + ul, ol, li, dl, dt, dd, footer, |
| 113 | + div.verse .attribution, table.table th, table.table td, |
| 114 | + figcaption, caption, |
| 115 | + h1, h2, h3, h4, h5 { |
| 116 | + color: #000000; |
| 117 | + } |
| 118 | + |
| 119 | + body a:link, |
| 120 | + div.abstract > p a:link { |
| 121 | + color: #000000; |
| 122 | + -webkit-text-fill-color: #000000; |
| 123 | + } |
| 124 | + |
| 125 | + body a:visited { |
| 126 | + color: #333332; |
| 127 | + -webkit-text-fill-color: #333332; |
| 128 | + } |
| 129 | + |
| 130 | + .chapter-header { |
| 131 | + color: #191918; |
| 132 | + border-bottom-color: #191918; |
| 133 | + } |
| 134 | + |
| 135 | + h1.chapter-title .subtitle, |
| 136 | + .chapter-header p.byline { |
| 137 | + color: #000000; |
| 138 | + } |
| 139 | +} |
| 140 | + |
| 141 | +.chapter-header p.byline { |
| 142 | + height: auto; /* Aldiko requires this value to be 0; reset it for all others */ |
| 143 | +} |
| 144 | + |
| 145 | +/* Font-based icons */ |
| 146 | +.icon { |
| 147 | + display: inline-block; |
| 148 | + /* !important required to override custom font setting in Kindle (since .icon can appear inside a span) */ |
| 149 | + font-family: "FontAwesome" !important; |
| 150 | + font-style: normal !important; |
| 151 | + font-weight: normal !important; |
| 152 | + line-height: 1; |
| 153 | +} |
| 154 | + |
| 155 | +.icon-1_5x { |
| 156 | + padding: 0 0.25em; |
| 157 | + -webkit-transform: scale(1.5, 1.5); |
| 158 | + transform: scale(1.5, 1.5); |
| 159 | +} |
| 160 | + |
| 161 | +.icon-2x { |
| 162 | + padding: 0 0.5em; |
| 163 | + -webkit-transform: scale(2, 2); |
| 164 | + transform: scale(2, 2); |
| 165 | +} |
| 166 | + |
| 167 | +.icon-small { |
| 168 | + font-size: 0.85em; |
| 169 | + vertical-align: 0.075em; |
| 170 | +} |
| 171 | + |
| 172 | +.icon-1_5em { |
| 173 | + font-size: 1.5em; |
| 174 | +} |
| 175 | + |
| 176 | +.icon-2em { |
| 177 | + font-size: 2em; |
| 178 | +} |
| 179 | + |
| 180 | +.icon-3em { |
| 181 | + font-size: 3em; |
| 182 | +} |
| 183 | + |
| 184 | +.icon-4em { |
| 185 | + font-size: 4em; |
| 186 | +} |
| 187 | + |
| 188 | +.icon-rotate-90 { |
| 189 | + -webkit-transform: rotate(90deg); |
| 190 | + transform: rotate(90deg); |
| 191 | +} |
| 192 | + |
| 193 | +.icon-rotate-90i { |
| 194 | + -webkit-transform: scale(-1, 1) rotate(90deg); |
| 195 | + transform: scale(-1, 1) rotate(90deg); |
| 196 | +} |
| 197 | + |
| 198 | +.icon-rotate-180 { |
| 199 | + -webkit-transform: rotate(180deg); |
| 200 | + transform: rotate(180deg); |
| 201 | +} |
| 202 | + |
| 203 | +.icon-rotate-180i { |
| 204 | + -webkit-transform: scale(-1, 1) rotate(180deg); |
| 205 | + transform: scale(-1, 1) rotate(180deg); |
| 206 | +} |
| 207 | + |
| 208 | +.icon-rotate-270 { |
| 209 | + -webkit-transform: rotate(270deg); |
| 210 | + transform: rotate(270deg); |
| 211 | +} |
| 212 | + |
| 213 | +.icon-rotate-270i { |
| 214 | + -webkit-transform: scale(-1, 1) rotate(270deg); |
| 215 | + transform: scale(-1, 1) rotate(270deg); |
| 216 | +} |
| 217 | + |
| 218 | +.icon-flip-h { |
| 219 | + -webkit-transform: scale(-1, 1); |
| 220 | + transform: scale(-1, 1); |
| 221 | +} |
| 222 | + |
| 223 | +.icon-flip-v { |
| 224 | + -webkit-transform: scale(1, -1); |
| 225 | + transform: scale(1, -1); |
| 226 | +} |
0 commit comments