-
Notifications
You must be signed in to change notification settings - Fork 20
/
ReadiumCSS-base.css
208 lines (161 loc) · 7.85 KB
/
ReadiumCSS-base.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
/* Readium CSS
Base module
A minimal stylesheet for all ebooks
Repo: https://github.com/readium/readium-css */
/* Define viewport, HTML5-style */
@-ms-viewport {
width: device-width;
}
@viewport {
width: device-width;
zoom: 1;
}
:root {
/* Default font-stacks */
--RS__oldStyleTf: "Iowan Old Style", "Sitka Text", Palatino, "Book Antiqua", serif;
--RS__modernTf: Athelas, Constantia, Georgia, serif;
--RS__sansTf: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
--RS__humanistTf: Seravek, Calibri, Roboto, Arial, sans-serif;
--RS__monospaceTf: "Andale Mono", Consolas, monospace;
/* Config */
--RS__baseFontFamily: var(--RS__oldStyleTf);
/* For square-ish fonts (CJK, Indic, etc.), we must apply some compensation in dynamic leading. Default is 1 i.e. no compensation */
--RS__lineHeightCompensation: 1;
/* Dynamic leading based on typeface metrics + font-size setting */
--RS__baseLineHeight: calc((1em + (2ex - 1ch) - ((1rem - 16px) * 0.1667)) * var(--RS__lineHeightCompensation));
}
/* Set default font for the html doc, so that it can be overridden by the authors’s stylesheet */
html {
font-family: var(--RS__baseFontFamily);
/* Fallback line-height */
line-height: 1.6; /* Fits a little bit better for all languages than 1.5 */
line-height: var(--RS__baseLineHeight);
text-rendering: optimizeLegibility;
}
/* 1.5 being too loose with larger font-sizes, we reset headings to normal (which value is 1.125–1.375 for our font-stacks) */
h1, h2, h3 {
line-height: normal;
}
:lang(ja),
:lang(zh),
:lang(ko) {
word-wrap: break-word;
-webkit-line-break: strict;
-epub-line-break: strict;
line-break: strict;
}
/* Set default font for Math */
math {
font-family: "Latin Modern Math", "STIX Two Math", "XITS Math", "STIX Math", "Libertinus Math", "TeX Gyre Termes Math", "TeX Gyre Bonum Math", "TeX Gyre Schola", "DejaVu Math TeX Gyre", "TeX Gyre Pagella Math", "Asana Math", "Cambria Math", "Lucida Bright Math", "Minion Math", STIXGeneral, STIXSizeOneSym, Symbol, "Times New Roman", serif;
}
/* Language Overrides
That will only work if either html or body have a (xml:)lang attribute, not for inline overrides */
:lang(am) {
--RS__baseFontFamily: Kefa, Nyala, Roboto, Noto, "Noto Sans Ethiopic", serif;
--RS__lineHeightCompensation: 1.167;
}
:lang(ar) {
--RS__baseFontFamily: "Geeza Pro", "Arabic Typesetting", Roboto, Noto, "Noto Naskh Arabic", "Times New Roman", serif;
}
:lang(bn) {
--RS__baseFontFamily: "Kohinoor Bangla", "Bangla Sangam MN", Vrinda, Roboto, Noto, "Noto Sans Bengali", sans-serif;
--RS__lineHeightCompensation: 1.067;
}
:lang(bo) {
--RS__baseFontFamily: Kailasa, "Microsoft Himalaya", Roboto, Noto, "Noto Sans Tibetan", sans-serif;
}
:lang(chr) {
--RS__baseFontFamily: "Plantagenet Cherokee", Roboto, Noto, "Noto Sans Cherokee";
--RS__lineHeightCompensation: 1.167;
}
:lang(fa) {
--RS__baseFontFamily: "Geeza Pro", "Arabic Typesetting", Roboto, Noto, "Noto Naskh Arabic", "Times New Roman", serif;
}
:lang(gu) {
--RS__baseFontFamily: "Gujarati Sangam MN", "Nirmala UI", Shruti, Roboto, Noto, "Noto Sans Gujarati", sans-serif;
--RS__lineHeightCompensation: 1.167;
}
:lang(he) {
--RS__baseFontFamily: "New Peninim MT", "Arial Hebrew", Gisha, "Times New Roman", Roboto, Noto, "Noto Sans Hebrew" sans-serif;
--RS__lineHeightCompensation: 1.1;
}
:lang(hi) {
--RS__baseFontFamily: "Kohinoor Devanagari", "Devanagari Sangam MN", Kokila, "Nirmala UI", Roboto, Noto, "Noto Sans Devanagari", sans-serif;
--RS__lineHeightCompensation: 1.1;
}
:lang(hy) {
--RS__baseFontFamily: Mshtakan, Sylfaen, Roboto, Noto, "Noto Serif Armenian", serif;
}
:lang(iu) {
--RS__baseFontFamily: "Euphemia UCAS", Euphemia, Roboto, Noto, "Noto Sans Canadian Aboriginal", sans-serif;
}
:lang(ja) {
--RS__baseFontFamily: "游ゴシック体", YuGothic, "ヒラギノ丸ゴ", "Hiragino Sans", "Yu Gothic UI", "Meiryo UI", "MS Gothic", Roboto, Noto, "Noto Sans CJK JP", sans-serif;
/* For CJK, the line-height is usually 15–20% more than for Latin */
--RS__lineHeightCompensation: 1.167;
/* Extra variables for Japanese font-stacks as we may want to reuse them for user settings + default */
--RS__serif-ja: "MS P明朝", "MS PMincho", "Hiragino Mincho Pro", "ヒラギノ明朝 Pro W3", "游明朝", "YuMincho", "MS 明朝", "MS Mincho", "Hiragino Mincho ProN", serif;
--RS__sans-serif-ja: "MS Pゴシック", "MS PGothic", "Hiragino Kaku Gothic Pro W3", "ヒラギノ角ゴ Pro W3", "Hiragino Sans GB", "ヒラギノ角ゴシック W3", "游ゴシック", "YuGothic", "MS ゴシック", "MS Gothic", "Hiragino Sans", sans-serif;
--RS__serif-ja-v: "MS 明朝", "MS Mincho", "Hiragino Mincho Pro", "ヒラギノ明朝 Pro W3", "游明朝", "YuMincho", "MS P明朝", "MS PMincho", "Hiragino Mincho ProN", serif;
--RS__sans-serif-ja-v: "MS ゴシック", "MS Gothic", "Hiragino Kaku Gothic Pro W3", "ヒラギノ角ゴ Pro W3", "Hiragino Sans GB", "ヒラギノ角ゴシック W3", "游ゴシック", "YuGothic", "MS Pゴシック", "MS PGothic", "Hiragino Sans", sans-serif;
}
:lang(km) {
--RS__baseFontFamily: "Khmer Sangam MN", "Leelawadee UI", "Khmer UI", Roboto, Noto, "Noto Sans Khmer", sans-serif;
--RS__lineHeightCompensation: 1.067;
}
:lang(kn) {
--RS__baseFontFamily: "Kannada Sangam MN", "Nirmala UI", Tunga, Roboto, Noto, "Noto Sans Kannada", sans-serif;
--RS__lineHeightCompensation: 1.1;
}
:lang(ko) {
--RS__baseFontFamily: "Nanum Gothic", "Apple SD Gothic Neo", "Malgun Gothic", Roboto, Noto, "Noto Sans CJK KR", sans-serif;
/* For CJK, the line-height is usually 15–20% more than for Latin */
--RS__lineHeightCompensation: 1.167;
}
:lang(lo) {
--RS__baseFontFamily: "Lao Sangam MN", "Leelawadee UI", "Lao UI", Roboto, Noto, "Noto Sans Lao", sans-serif;
}
:lang(ml) {
--RS__baseFontFamily: "Malayalam Sangam MN", "Nirmala UI", Kartika, Roboto, Noto, "Noto Sans Malayalam", sans-serif;
--RS__lineHeightCompensation: 1.067;
}
:lang(or) {
--RS__baseFontFamily: "Oriya Sangam MN", "Nirmala UI", Kalinga, Roboto, Noto, "Noto Sans Oriya", sans-serif;
--RS__lineHeightCompensation: 1.167;
}
:lang(pa) {
--RS__baseFontFamily: "Gurmukhi MN", "Nirmala UI", Kartika, Roboto, Noto, "Noto Sans Gurmukhi", sans-serif;
--RS__lineHeightCompensation: 1.1;
}
:lang(si) {
--RS__baseFontFamily: "Sinhala Sangam MN", "Nirmala UI", "Iskoola Pota", Roboto, Noto, "Noto Sans Sinhala", sans-serif;
--RS__lineHeightCompensation: 1.167;
}
:lang(ta) {
--RS__baseFontFamily: "Tamil Sangam MN", "Nirmala UI", Latha, Roboto, Noto, "Noto Sans Tamil", sans-serif;
--RS__lineHeightCompensation: 1.067;
}
:lang(te) {
--RS__baseFontFamily: "Kohinoor Telugu", "Telugu Sangam MN", "Nirmala UI", Gautami, Roboto, Noto, "Noto Sans Telugu", sans-serif;
}
:lang(th) {
--RS__baseFontFamily: "Thonburi", "Leelawadee UI", "Cordia New", Roboto, Noto, "Noto Sans Thai", sans-serif;
--RS__lineHeightCompensation: 1.067;
}
/* The following will also work for zh-Hans */
:lang(zh) {
--RS__baseFontFamily: "方体", "PingFang SC", "黑体", "Heiti SC", "Microsoft JhengHei UI", "Microsoft JhengHei", Roboto, Noto, "Noto Sans CJK SC", sans-serif;
/* For CJK, the line-height is usually 15–20% more than for Latin */
--RS__lineHeightCompensation: 1.167;
}
:lang(zh-Hant),
:lang(zh-TW) {
--RS__baseFontFamily: "方體", "PingFang TC", "黑體", "Heiti TC", "Microsoft JhengHei UI", "Microsoft JhengHei", Roboto, Noto, "Noto Sans CJK TC", sans-serif;
/* For CJK, the line-height is usually 15–20% more than for Latin */
--RS__lineHeightCompensation: 1.167;
}
:lang(zh-HK) {
--RS__baseFontFamily: "方體", "PingFang HK", "方體", "PingFang TC", "黑體", "Heiti TC", "Microsoft JhengHei UI", "Microsoft JhengHei", Roboto, Noto, "Noto Sans CJK TC", sans-serif;
/* For CJK, the line-height is usually 15–20% more than for Latin */
--RS__lineHeightCompensation: 1.167;
}