forked from booktype/BookJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbook.css
251 lines (197 loc) · 4.46 KB
/
book.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
/* background color is grey */
body {
background-color:#efefef;
}
/* size of pages: A5 */
@page {
size:5.8in 8.3in; /* Setting seems to be ignored due to webkit bug */
}
.page {
height:8.3in;
width:5.8in;
page-break-after:always;
}
/* height of pages when no CSS regions present: auto. Also add some padding. */
.page.simple {
height:auto;
padding: 1in;
}
/* Every .page contains various elements (.contents, .header, .pagenumber) that together make out the page. The elements are placed with absolute coordinates in relation to the page and are, if not specified otherwise, centered. Pages have white background color */
.page {
position:relative;
margin-left:auto;
margin-right:auto;
background-color:#fff;
}
/* When showing the page on the screen, put a border around the page and add a little margin beween the pages. */
@media screen{
.page {
border:solid 1px #000;
margin-bottom:.2in;
}
}
/* The .contentsContianer contains the .contents and the .footnotes */
.contentsContainer {
height:6.67in;
width:4.03in;
position:absolute;
bottom:.8in;
}
/* images should not overflow the contents box */
img {
max-height: 6.57in; /* page height - .1in */
max-width: 3.93in; /* page width - .1in */
-webkit-region-break-before: always;
-webkit-region-break-after: always;
}
.pagenumber {
margin-top:.2in;
position:absolute;
bottom:.4in;
left:0;
right:0;
font-size:15px;
}
.header {
margin-bottom:.2in;
position:absolute;
top:.4in;
left:0;
right:0;
font-size:13px;
}
/* Don't display section titles in the header on odd pages */
.page:nth-child(odd) .header .section {
display:none;
}
/* Don't display chapter titles in the header on even pages */
.page:nth-child(even) .header .chapter {
display:none;
}
/* Centering the page number on first pages of chapters */
.chapter .page:first-child .pagenumber {
text-align: center;
margin-left: auto;
margin-right: auto;
}
/* ELEMENTS OF THE TABLE OF CONTENTS */
/* The title text of the TOC */
#toc-title:before {
content:"Contents";
}
/* Styling of the TOC title */
#toc-title {
font-size:22px;
font-weight:700;
text-align:left;
padding-bottom:.4in;
}
/* Styling of individual toc entry */
.toc-entry {
width:4.2in;
display:block;
padding-bottom:.3in;
}
/* Page numbers of toc entries should float to the right and have normal font weight */
.toc-entry .toc-pagenumber {
font-weight:400;
display:inline-block;
vertical-align:text-bottom;
font-size:16px;
float:right;
}
/* special styling for TOC entries that represent sections */
.toc-entry.section {
font-weight:700;
font-size:16px;
text-transform:uppercase;
padding-bottom:.3in;
}
/* Left and right page gutter */
.page:nth-child(odd) .contentsContainer {
right:.6in;
}
.page:nth-child(even) .contentsContainer {
left:.6in;
}
/* Left and right page page numbers and headers */
.page:nth-child(odd) .pagenumber,.page:nth-child(odd) .header {
margin-right:.6in;
text-align:right;
}
.page:nth-child(even) .pagenumber,.page:nth-child(even) .header {
margin-left:.6in;
text-align:left;
}
/* No page number on section start pages and on title page */
.section .page:first-child .pagenumber,#frontmatter .page:first-child .pagenumber {
display:none;
}
/* No header on section and chapter start pages */
.section .page:first-child .header,.chapter .page:first-child .header {
display:none;
}
/* Manual page breaks */
.pagebreak {
-webkit-region-break-after:always;
}
/* Work-around to make section title pages no longer than one page */
.objavi-subsection-heading {
line-height:120px!important;
font-size:22px;
font-weight:700;
text-align:left;
display:none;
}
/* Custom CSS for elements that do not come directly out of body.html */
#booktitle {
margin-top:1.7in;
font-size:26px;
font-weight:700;
text-align:center;
}
#booksubtitle {
font-size:18px;
margin-top:.2in;
font-weight:700;
text-align:center;
}
#bookeditors {
padding-top:2in;
font-weight:700;
text-align:center;
font-size:12px;
}
/* General CSS for contents */
p {
font-size:15px;
line-height:20px;
text-align:justify;
}
h1 {
font-size:21px;
}
h2 {
font-size:19px;
}
h3 {
font-size:17px;
}
/* Styling of footnotes */
.footnote > * > * {
font-size:12px;
line-height: 1em;
margin:.25em;
}
.footnote > * > *::before, .footnote::before {
position: relative; top: -0.5em; font-size: 80%;
}
.footnote {
font-size:10px;
font-weight: bold;
}
/* If footnotes are present, a margin of .2in is added between .contents and .footnotes and a black line is drawn above the footnotes. */
.footnotes div.footnoteItem:first-child {
padding-top: .5em;
border-top: 1px solid black;
}