-
Notifications
You must be signed in to change notification settings - Fork 0
/
unhcr-generic-page.css
261 lines (243 loc) · 5.52 KB
/
unhcr-generic-page.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
252
253
254
255
256
257
258
259
260
261
/*****
Main page size
*****/
@page {
size: A4 portrait; /* var(--pagedjs-width) doesn't work in browser when printing */
margin: 40mm 25mm 25mm 25mm;
}
@page :blank {
}
/*****
Store some string variables
*****/
.date {
string-set: date-text content(text);
}
.title {
string-set: title-text content(text);
}
.subtitle {
string-set: subtitle-text content(text);
}
.shorttitle1 {
string-set: h1-text content(text);
}
.shorttitle2 {
string-set: h2-text content(text);
}
@page chapter:left {
@top-left {
content: string(title-text) " > " string(subtitle-text);
margin-left: -10mm;
margin-top: 10mm;
color: var(--unhcr-grey60);
font-size: 0.8em;
text-transform: uppercase;
vertical-align: top;
}
@bottom-right {
content: "UNHCR / " string(date-text);
margin-right: -10mm;
margin-top: 10mm;
padding-top: 1.5mm;
color: var(--unhcr-blue);
font-size: 0.7em;
vertical-align: top;
border-top: 0.5px solid var(--unhcr-blue);
}
@bottom-left {
content: counter(page);
margin-left: -10mm;
margin-top: 10mm;
padding-top: 1.5mm;
color: var(--unhcr-blue);
font-size: 0.7em;
vertical-align: top;
border-top: 0.5px solid var(--unhcr-blue);
}
background-image: url(header-ruler-left.svg);
background-position: 15mm 15mm;
background-size: 180mm;
background-repeat: no-repeat;
}
@page chapter:right {
@top-right {
content: string(title-text) " > " string(subtitle-text);
margin-right: -10mm;
margin-top: 10mm;
color: var(--unhcr-grey60);
font-size: 0.8em;
text-transform: uppercase;
vertical-align: top;
}
@bottom-left {
content: "UNHCR / " string(date-text);
margin-left: -10mm;
margin-top: 10mm;
padding-top: 1.5mm;
color: var(--unhcr-blue);
font-size: 0.7em;
vertical-align: top;
border-top: 0.5px solid var(--unhcr-blue);
}
@bottom-right {
content: counter(page);
margin-right: -10mm;
margin-top: 10mm;
padding-top: 1.5mm;
color: var(--unhcr-blue);
font-size: 0.7em;
vertical-align: top;
border-top: 0.5px solid var(--unhcr-blue);
}
background-image: url(header-ruler-right.svg);
background-position: 15mm 15mm;
background-size: 180mm;
background-repeat: no-repeat;
}
@page :first {
margin: 30mm 10mm 10mm 10mm;
@top-left {
content: url("unhcr-logo.svg");
width: 62.5mm;
margin-top: 14mm;
}
@top-right {
content: none;
}
@bottom-left {
content: none !important;
}
@bottom-right {
content: none !important;
}
background-image: var(--front-cover);
background-position: 10mm 30mm;
background-size: 190mm 257mm;
background-repeat: no-repeat;
}
/* Front cover */
/* Front page or title page */
.front-page {
counter-reset: page;
break-after: left;
}
/* Front matter*/
@page frontmatter:left {
@top-left {
content: string(title-text) " > " string(subtitle-text);
margin-left: -10mm;
margin-top: 10mm;
color: var(--unhcr-grey60);
font-size: 0.8em;
text-transform: uppercase;
vertical-align: top;
}
@bottom-right {
content: "UNHCR / " string(date-text);
margin-right: -10mm;
margin-top: 10mm;
padding-top: 1.5mm;
color: var(--unhcr-blue);
font-size: 0.7em;
vertical-align: top;
border-top: 0.5px solid var(--unhcr-blue);
}
@bottom-left {
content: counter(page);
margin-left: -10mm;
margin-top: 10mm;
padding-top: 1.5mm;
color: var(--unhcr-blue);
font-size: 0.7em;
vertical-align: top;
border-top: 0.5px solid var(--unhcr-blue);
}
background-image: url(header-ruler-left.svg);
background-position: 15mm 15mm;
background-size: 180mm;
background-repeat: no-repeat;
}
@page frontmatter:right {
@top-right {
content: string(title-text) " > " string(subtitle-text);
margin-right: -10mm;
margin-top: 10mm;
color: var(--unhcr-grey60);
font-size: 0.8em;
text-transform: uppercase;
vertical-align: top;
}
@bottom-left {
content: "UNHCR / " string(date-text);
margin-left: -10mm;
margin-top: 10mm;
padding-top: 1.5mm;
color: var(--unhcr-blue);
font-size: 0.7em;
vertical-align: top;
border-top: 0.5px solid var(--unhcr-blue);
}
@bottom-right {
content: counter(page);
margin-right: -10mm;
margin-top: 10mm;
padding-top: 1.5mm;
color: var(--unhcr-blue);
font-size: 0.7em;
vertical-align: top;
border-top: 0.5px solid var(--unhcr-blue);
}
background-image: url(header-ruler-right.svg);
background-position: 15mm 15mm;
background-size: 180mm;
background-repeat: no-repeat;
}
/* last page or back cover */
.back-cover {
break-before: left;
page: backmatter;
}
.pagedjs_page:nth-last-of-type(1) {
background-image: var(--back-cover);
background-position: 10mm 30mm;
background-size: 190mm 257mm;
background-repeat: no-repeat;
}
.back-title:after {
content: string(title-text);
}
.back-subtitle:after {
content: string(subtitle-text);
}
/* page breaks; aka CSS fragmentation */
.level1 {
page: chapter;
}
.main .level1 {
break-before: page;
}
.front-matter-container .level1 {
page: frontmatter;
break-before: page;
}
.section > h1, .section > h2, .section > h3, .section > h4, .section > h5, .section > h6 {
break-after: avoid;
}
.footenotes {
break-before: always;
break-after: always;
}
.figure {
break-inside: avoid;
}
/* reset page numbering for main content */
/*.main .level1:first-child h1 {
counter-reset: page;
} */
/* do not break captions */
caption,
.caption {
break-inside: avoid;
break-after: avoid;
}