UNPKG

30.2 kBCSSView Raw
1/* Readium CSS
2 Config module
3
4 A file allowing implementers to customize flags for reading modes,
5 user settings, etc.
6
7 Repo: https://github.com/readium/readium-css */
8
9/* Custom medias
10 Syntax: @custom-media --variable (prop: value) */
11
12/* Responsive columns
13 The minimum width for which responsive columns (2 -> 1 and vice versa,
14 depending on the current font-size) must be enabled */
15
16/* Mobile columns
17 The minimum and maximum width for mobile devices.
18 We’re forcing the landscape orientation by default,
19 and must still investigate large tablets (iPad Pro, Surface Pro 3, etc.). */
20
21/* Custom selectors
22 Syntax: @custom-selector :--variable selector
23 The selectors you will use for flags/switches
24 You can alternatively use classes or custom data-* attributes */
25
26/* User view = paged | scrolled */
27
28/* Font-family override */
29
30/* Advanced settings */
31
32/* Reading Modes */
33
34/* Filters (images) */
35
36/* Accessibility normalization */
37
38/* Accessibility font. You can add selectors, using “, ” as a separator, if you have multiple fonts */
39
40/* Direction i.e. ltr and rtl */
41
42/* Readium CSS
43 Pagination module
44
45 A set of styles to paginate ePublications
46
47 Repo: https://github.com/readium/readium-css */
48
49/* Config */
50
51/* Columns are responsive by default, even if column-width is set in pixels,
52 which means two-page spread will switch to single page depending on current font-size.
53 If you want more control, I’m afraid you’ll have to update colWidth/colGap dynamically,
54 which is how a significant amount of RS do at the moment. */
55
56/* Default for smartphone portrait (small screens) */
57
58:root {
59 /* Your columns’ width floor */
60 --RS__colWidth: 45em; /* The width at which we’ll switch to 2 columns by default. PS: you can’t set it in rem */
61
62 /* Ideal number of columns (depending on columns’ width floor) */
63 --RS__colCount: 1;
64
65 /* Gap between columns (in pixels so that it won’t resize with font-size) */
66 --RS__colGap: 0;
67
68 /* Optimal line-length (rem will take :root font-size into account, whatever the body’s font-size) */
69 --RS__maxLineLength: 40rem;
70
71 /* Default page horizontal margins (in pixels so that it won’t resize with font-size) */
72 --RS__pageGutter: 20px; /* See if colGap and pageGutter can be the same var */
73}
74
75/* Reset page margins for Forward compatibility */
76
77@page {
78 margin: 0 !important;
79}
80
81/* :root selector has same specificity as a class i.e. 0010
82 We might have to change that to html / context
83 -> https://css-tricks.com/almanac/selectors/r/root/ */
84
85:root {
86
87 /* In case you use left position to scroll, can be removed if using transform: translateX() */
88 position: relative;
89
90 -webkit-column-width: var(--RS__colWidth);
91 -moz-column-width: var(--RS__colWidth);
92 column-width: var(--RS__colWidth);
93
94 /* Init pagination */
95 /* TODO: document columns’ logic cos it might feel weird at first */
96 -webkit-column-count: var(--RS__colCount);
97 -moz-column-count: var(--RS__colCount);
98 column-count: var(--RS__colCount);
99
100 -webkit-column-gap: var(--RS__colGap);
101 -moz-column-gap: var(--RS__colGap);
102 column-gap: var(--RS__colGap);
103
104 /* Default is balance and we want columns to be filled entirely (100vh) */
105 -moz-column-fill: auto;
106 column-fill: auto;
107 width: 100%;
108 height: 100vh;
109 max-width: 100%;
110 max-height: 100vh;
111 min-width: 100%;
112 min-height: 100vh;
113 padding: 0 !important;
114 margin: 0 !important;
115
116 /* Column size will depend on this if we want to make it responsive */
117 font-size: 100% !important;
118
119 -webkit-text-size-adjust: 100%;
120
121 /* Switch to newer box model (not inherited by authors’ styles) */
122 box-sizing: border-box;
123
124 /* Fix bug for older Chrome */
125 -webkit-perspective: 1;
126 /* Prevents options pop-up when long tap in webkit */
127 -webkit-touch-callout: none;
128}
129
130body {
131 /* overflow: hidden; bugfix: contents won’t paginate in Firefox and one sample in Safari */
132 width: 100%;
133
134 /* Limit line-length but we have to reset when 2 columns and control the viewport.
135 By using max-width + margin auto, margins will shrink when font-size increases,
136 which is what would be expected in terms of typography. */
137 max-width: var(--RS__maxLineLength) !important;
138 padding: 0 var(--RS__pageGutter) !important;
139 margin: 0 auto !important;
140
141 /* We need a minimum padding on body so that descandants/ascendants in italic/script are not cut-off.
142 Drawback: we have to use border-box so that it doesn’t screw the box model,
143 which means it impacts colWidth and max-width */
144 box-sizing: border-box;
145}
146
147/* We’ll now redefine margins and columns depending on the minimum width available
148 The goal is having the simplest model possible and avoid targeting devices */
149
150/* Smartphone landscape */
151
152@media screen and (min-width: 35em) {
153 :root {
154 --RS__pageGutter: 30px;
155 }
156}
157
158/* Tablet portrait */
159
160@media screen and (min-width: 45em) {
161 :root {
162 --RS__pageGutter: 40px;
163 }
164}
165
166/* Desktop + tablet large */
167
168/* We get the previous settings, we just change the margins */
169
170@media screen and (min-width: 75em) {
171 :root {
172 --RS__pageGutter: 50px;
173 }
174}
175
176/* At this point (80em or so), constraining line length must be done at the web view/iframe level, or by limiting the size of :root itself */
177
178/* Responsive columns */
179
180@media screen and (min-width: 60em), screen and (min-device-width: 36em) and (max-device-width: 47em) and (orientation: landscape) {
181 :root {
182 /* The size at which we want 2 columns to switch to 1 (depending on font-size) */
183 --RS__colWidth: 20em; /* 20 * 16 = 320px but 20 * 28 = 560px so it will switch to 1 col @ 175% font-size (user-setting) on an iPad */
184 /* We constrain to 2 columns so that we can never get 3 or 4, etc. */
185 --RS__colCount: 2;
186 --RS__maxLineLength: 39.99rem; /* If we don’t use this, colNumber user setting won’t work in Safari… */
187 }
188}
189
190/* Readium CSS
191 Scroll module
192
193 A set of styles to scroll ePublications
194 This module overrides pagination
195
196 Repo: https://github.com/readium/readium-css */
197
198:root[style*="readium-scroll-on"] {
199
200 /* Reset columns, auto + auto = columns can’t be created */
201 -webkit-columns: auto auto !important;
202 -moz-columns: auto auto !important;
203 columns: auto auto !important;
204 width: auto !important;
205 height: auto !important;
206 max-width: none !important;
207 max-height: none !important;
208 /* Reset html size so that the user can scroll */
209 min-width: 0 !important;
210 min-height: 0 !important;
211}
212
213/* Make sure line-length is limited in all configs */
214
215:root[style*="readium-scroll-on"] body {
216 --RS__maxLineLength: 40rem !important;
217}
218
219/* Readium CSS
220 Default highlights
221
222 A stylesheet for user highlights
223
224 Repo: https://github.com/readium/readium-css */
225
226/* User Highlights */
227
228.readiumCSS-yellow-highlight {
229 background-color: rgba(255, 255, 0, 0.5);
230}
231
232.readiumCSS-green-highlight {
233 background-color: rgba(0, 255, 0, 0.5);
234}
235
236.readiumCSS-orange-highlight {
237 background-color: rgba(255, 165, 0, 0.5);
238}
239
240.readiumCSS-pink-highlight {
241 background-color: rgba(255, 105, 180, 0.5);
242}
243
244/* Media overlays */
245
246.readiumCSS-mo-active-default {
247 color: black !important;
248 background-color: yellow !important;
249}
250
251/* Readium CSS
252 Night mode
253
254 A preset theme for night mode
255
256 Repo: https://github.com/readium/readium-css */
257
258/* CONFIG */
259
260/* [style*="--USER__appearance"] can be used to increase specificity but performance hit */
261
262:root[style*="readium-night-on"] {
263 --RS__backgroundColor: #000000;
264 --RS__textColor: #FEFEFE;
265
266 --RS__linkColor: #63caff;
267 --RS__visitedColor: #0099E5;
268
269 /* This can be customized but initial will re-use default value of the browser */
270 --RS__selectionBackgroundColor: #b4d8fe;
271 --RS__selectionTextColor: inherit;
272}
273
274/* we don’t need to redeclare bg-color and color for :root since we will inherit and update from day/default mode */
275
276:root[style*="readium-night-on"] *:not(a) {
277 color: inherit !important;
278 background-color: transparent !important;
279 border-color: currentColor !important;
280}
281
282:root[style*="readium-night-on"] svg text {
283 fill: currentColor !important;
284 stroke: none !important;
285}
286
287:root[style*="readium-night-on"] a:link,
288:root[style*="readium-night-on"] a:link * {
289 color: var(--RS__linkColor) !important;
290}
291
292:root[style*="readium-night-on"] a:visited,
293:root[style*="readium-night-on"] a:visited * {
294 color: var(--RS__visitedColor) !important;
295}
296
297:root[style*="readium-night-on"] img[class*="gaiji"],
298:root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child {
299 -webkit-filter: invert(100%);
300 filter: invert(100%);
301}
302
303/* Darken all images on user’s demand */
304
305:root[style*="readium-night-on"][style*="readium-darken-on"] img {
306 -webkit-filter: brightness(80%);
307 filter: brightness(80%);
308}
309
310/* Invert all images on user’s demand */
311
312:root[style*="readium-night-on"][style*="readium-invert-on"] img {
313 -webkit-filter: invert(100%);
314 filter: invert(100%);
315}
316
317/* Darken and invert on user’s demand */
318
319:root[style*="readium-night-on"][style*="readium-darken-on"][style*="readium-invert-on"] img {
320 -webkit-filter: brightness(80%) invert(100%);
321 filter: brightness(80%) invert(100%);
322}
323
324/* Readium CSS
325 Sepia mode
326
327 A preset theme for sepia mode
328
329 Repo: https://github.com/readium/readium-css */
330
331/* CONFIG */
332
333:root[style*="readium-sepia-on"] {
334 --RS__backgroundColor: #faf4e8;
335 --RS__textColor: #121212;
336
337 --RS__linkColor: #0000EE;
338 --RS__visitedColor: #551A8B;
339
340 /* This can be customized but initial will re-use default value of the browser */
341 --RS__selectionBackgroundColor: #b4d8fe;
342 --RS__selectionTextColor: inherit;
343
344 --RS__maxLineLength: 40.01rem; /* Forcing a reflow in Blink/Webkit so that blend mode can work */
345}
346
347/* we don’t need to redeclare bg-color and color for :root since we will inherit and update from day/default mode */
348
349:root[style*="readium-sepia-on"] body {
350 /* Should be transparent but Chrome bug https://bugs.chromium.org/p/chromium/issues/detail?id=711955&q=mix-blend-mode&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified */
351
352 color: inherit;
353 background-color: var(--RS__backgroundColor);
354}
355
356:root[style*="readium-sepia-on"] a:link,
357:root[style*="readium-sepia-on"] a:link * {
358 color: var(--RS__linkColor);
359}
360
361:root[style*="readium-sepia-on"] a:visited,
362:root[style*="readium-sepia-on"] a:visited * {
363 color: var(--RS__visitedColor);
364}
365
366:root[style*="readium-sepia-on"] svg,
367:root[style*="readium-sepia-on"] img {
368 /* Make sure the proper bg-color is used for the blend mode */
369 background-color: transparent !important;
370 mix-blend-mode: multiply;
371}
372
373/* Readium CSS
374 OS Accessibility Modes
375
376 A stylesheet to deal with OS accessibility settings
377
378 Repo: https://github.com/readium/readium-css */
379
380/* Windows high contrast colors are mapped to CSS system color keywords
381 See http://www.gwhitworth.com/blog/2017/04/how-to-use-ms-high-contrast */
382
383@media screen and (-ms-high-contrast: active) {
384 :root {
385 color: windowText !important;
386 background-color: window !important;
387 }
388
389 /* The following selectors are super funky but it makes sure everything is inherited, this is indeed critical for this mode */
390 :root :not(#\#):not(#\#):not(#\#),
391 :root :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#)
392 :root :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#) {
393 color: inherit !important;
394 background-color: inherit !important;
395 }
396
397 .readiumCSS-mo-active-default {
398 color: highlightText !important;
399 background-color: highlight !important;
400 }
401
402 /* For links, hyperlink keyword is automatically set */
403
404 /* Should we also set user highlights? */
405}
406
407@media screen and (-ms-high-contrast: white-on-black) {
408 :root[style*="readium-night-on"] img[class*="gaiji"],
409 :root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child {
410 -webkit-filter: none !important;
411 filter: none !important;
412 }
413 :root[style*="readium-night-on"][style*="readium-invert-on"] img {
414 -webkit-filter: none !important;
415 filter: none !important;
416 }
417 :root[style*="readium-night-on"][style*="readium-darken-on"][style*="readium-invert-on"] img {
418 -webkit-filter: brightness(80%);
419 filter: brightness(80%);
420 }
421}
422
423/* Will be true on recent versions of iOS and MacOS if inverted setting enabled by the user */
424
425@media screen and (inverted-colors) {
426 :root[style*="readium-night-on"] img[class*="gaiji"],
427 :root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child {
428 -webkit-filter: none !important;
429 filter: none !important;
430 }
431 :root[style*="readium-night-on"][style*="readium-invert-on"] img {
432 -webkit-filter: none !important;
433 filter: none !important;
434 }
435 :root[style*="readium-night-on"][style*="readium-darken-on"][style*="readium-invert-on"] img {
436 -webkit-filter: brightness(80%);
437 filter: brightness(80%);
438 }
439}
440
441@media screen and (monochrome) {
442 /* Grayscale (Implemented in Safari, what about eInk?) */
443 /* Must deal with anything color (contrast) so must be managed at the night/sepia/theme level :( */
444}
445
446@media screen and (prefers-reduced-motion) {
447 /* If reduced motion is set on MacOS, in case we have animation/transition */
448}
449
450/* Readium CSS
451 Columns number pref
452
453 A submodule managing columns number for user settings
454 Part of “Chrome Advanced” class – no flag required.
455
456 Repo: https://github.com/readium/readium-css */
457
458/* Number of columns = 1 | 2 */
459
460/* We still need to see if we allow users to force number of columns for all configs, currently it behaves as an "auto" setting */
461
462/* apply col setting except for mobile portrait */
463
464@media screen and (min-width: 60em), screen and (min-device-width: 36em) and (max-device-width: 47em) and (orientation: landscape) {
465 :root[style*="--USER__colCount: 1"],
466 :root[style*="--USER__colCount:1"],
467 :root[style*="--USER__colCount: 2"],
468 :root[style*="--USER__colCount:2"] {
469 -webkit-column-count: var(--USER__colCount);
470 -moz-column-count: var(--USER__colCount);
471 column-count: var(--USER__colCount);
472 }
473
474 /* If one column, make sure we limit line-length */
475 :root[style*="--USER__colCount: 1"],
476 :root[style*="--USER__colCount:1"] {
477 --RS__maxLineLength: 40rem !important; /* This is the only way for the user setting to work in webkit… */
478 --RS__colWidth: 100vw;
479 }
480
481 /* If smartphone landscape, and 2 columns, col width the same as iPad landscape + desktop */
482 :root[style*="--USER__colCount: 2"],
483 :root[style*="--USER__colCount:2"] {
484 --RS__colWidth: auto; /* User explicitely tells he/she wants 2 columns, we reset floor value */
485 }
486}
487
488/* Readium CSS
489 Page margins pref
490
491 A submodule managing page margins for user settings
492 Part of “Chrome Advanced” class – no flag required.
493
494 Repo: https://github.com/readium/readium-css */
495
496/* Page Margins: the user margin is a factor of the page gutter e.g. 0.5, 0.75, 1, 1.25, 1.5, etc. */
497
498:root[style*="--USER__pageMargins"] body {
499 padding: 0 calc(var(--RS__pageGutter) * var(--USER__pageMargins)) !important;
500}
501
502/* Readium CSS
503 Custom colors pref
504
505 A submodule managing custom colors for user settings
506 Part of “Chrome Advanced” class – no flag required.
507
508 Repo: https://github.com/readium/readium-css */
509
510:root[style*="--USER__backgroundColor"] {
511 background-color: var(--USER__backgroundColor) !important;
512}
513
514:root[style*="--USER__backgroundColor"] * {
515 background-color: transparent !important;
516}
517
518:root[style*="--USER__textColor"] {
519 color: var(--USER__textColor) !important;
520}
521
522:root[style*="--USER__textColor"] *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(pre) {
523 color: inherit !important;
524}
525
526/* Readium CSS
527 Text align pref
528
529 A submodule managing text-align for user settings
530 Part of “User Overrides Advanced” class – “advanced settings” flag required.
531
532 Repo: https://github.com/readium/readium-css */
533
534:root[style*="readium-advanced-on"][style*="--USER__textAlign"] {
535 text-align: var(--USER__textAlign);
536}
537
538:root[style*="readium-advanced-on"][style*="--USER__textAlign"] body,
539:root[style*="readium-advanced-on"][style*="--USER__textAlign"] *:not(blockquote):not(figcaption) p,
540:root[style*="readium-advanced-on"][style*="--USER__textAlign"] li {
541 text-align: inherit !important;
542 -moz-text-align-last: auto !important;
543 -epub-text-align-last: auto !important;
544 text-align-last: auto !important;
545}
546
547/* In case something goes wrong at the programmatic level + rtl for body + rtl in ltr */
548
549:root[style*="readium-advanced-on"][dir="rtl"][style*="--USER__textAlign: left"],
550:root[style*="readium-advanced-on"][dir="rtl"][style*="--USER__textAlign:left"],
551:root[style*="readium-advanced-on"][style*="--USER__textAlign: left"] *[dir="rtl"],
552:root[style*="readium-advanced-on"][style*="--USER__textAlign:left"] *[dir="rtl"] {
553 text-align: right;
554}
555
556/* Edge, if logical value is used, think of it as a polyfill. For LTR, it will fall back to the default, which is left */
557
558:root[style*="readium-advanced-on"][dir="rtl"][style*="--USER__textAlign: start"],
559:root[style*="readium-advanced-on"][dir="rtl"][style*="--USER__textAlign:start"] {
560 text-align: right;
561}
562
563/* Readium CSS
564 Hyphenation pref
565
566 A submodule managing hyphens for user settings
567 Part of “User Overrides Advanced” class – “advanced settings” flag required.
568
569 Repo: https://github.com/readium/readium-css */
570
571/* Managing hyphenation automatically for text-align values */
572
573:root[style*="readium-advanced-on"][style*="--USER__textAlign: justify"] body,
574:root[style*="readium-advanced-on"][style*="--USER__textAlign:justify"] body {
575 -webkit-hyphens: auto;
576 -moz-hyphens: auto;
577 -ms-hyphens: auto;
578 -epub-hyphens: auto;
579 hyphens: auto;
580}
581
582:root[style*="readium-advanced-on"][style*="--USER__textAlign: left"] body,
583:root[style*="readium-advanced-on"][style*="--USER__textAlign:left"] body,
584:root[style*="readium-advanced-on"][style*="--USER__textAlign: right"] body,
585:root[style*="readium-advanced-on"][style*="--USER__textAlign:right"] body {
586 -webkit-hyphens: none;
587 -moz-hyphens: none;
588 -ms-hyphens: none;
589 -epub-hyphens: none;
590 hyphens: none;
591}
592
593/* Managing the user override */
594
595:root[style*="readium-advanced-on"][style*="--USER__bodyHyphens"] {
596 -webkit-hyphens: var(--USER__bodyHyphens) !important;
597 -moz-hyphens: var(--USER__bodyHyphens) !important;
598 -ms-hyphens: var(--USER__bodyHyphens) !important;
599 -epub-hyphens: var(--USER__bodyHyphens) !important;
600 hyphens: var(--USER__bodyHyphens) !important;
601}
602
603/* Sorry, we can’t use `:matches`, `:-moz-any` or `:-webkit-any` because MS doesn’t support it yet */
604
605:root[style*="readium-advanced-on"][style*="--USER__bodyHyphens"] body,
606:root[style*="readium-advanced-on"][style*="--USER__bodyHyphens"] p,
607:root[style*="readium-advanced-on"][style*="--USER__bodyHyphens"] li,
608:root[style*="readium-advanced-on"][style*="--USER__bodyHyphens"] div,
609:root[style*="readium-advanced-on"][style*="--USER__bodyHyphens"] dd {
610 -webkit-hyphens: inherit;
611 -moz-hyphens: inherit;
612 -ms-hyphens: inherit;
613 -epub-hyphens: inherit;
614 hyphens: inherit;
615}
616
617/* Readium CSS
618 Font Family pref
619
620 A submodule managing font-family for user settings
621 Part of “User Overrides” class – “font override” flag required.
622
623 Repo: https://github.com/readium/readium-css */
624
625:root[style*="readium-font-on"][style*="--USER__fontFamily"] {
626 font-family: var(--USER__fontFamily) !important;
627}
628
629:root[style*="readium-font-on"][style*="--USER__fontFamily"] body,
630:root[style*="readium-font-on"][style*="--USER__fontFamily"] p,
631:root[style*="readium-font-on"][style*="--USER__fontFamily"] li,
632:root[style*="readium-font-on"][style*="--USER__fontFamily"] div,
633:root[style*="readium-font-on"][style*="--USER__fontFamily"] dt,
634:root[style*="readium-font-on"][style*="--USER__fontFamily"] dd {
635 font-family: inherit !important;
636}
637
638:root[style*="readium-font-on"][style*="--USER__fontFamily"] i:not([lang]),
639:root[style*="readium-font-on"][style*="--USER__fontFamily"] i:not([xml\:lang]),
640:root[style*="readium-font-on"][style*="--USER__fontFamily"] em:not([lang]),
641:root[style*="readium-font-on"][style*="--USER__fontFamily"] em:not([xml\:lang]),
642:root[style*="readium-font-on"][style*="--USER__fontFamily"] cite:not([lang]),
643:root[style*="readium-font-on"][style*="--USER__fontFamily"] cite:not([xml\:lang]),
644:root[style*="readium-font-on"][style*="--USER__fontFamily"] b:not([lang]),
645:root[style*="readium-font-on"][style*="--USER__fontFamily"] b:not([xml\:lang]),
646:root[style*="readium-font-on"][style*="--USER__fontFamily"] strong:not([lang]),
647:root[style*="readium-font-on"][style*="--USER__fontFamily"] strong:not([xml\:lang]),
648:root[style*="readium-font-on"][style*="--USER__fontFamily"] span:not([lang]),
649:root[style*="readium-font-on"][style*="--USER__fontFamily"] span:not([xml\:lang]) {
650 font-family: inherit !important;
651}
652
653/* Readium CSS
654 A11y font pref
655
656 A submodule managing a11y text normalization for user settings
657 Part of “User Overrides” class – “font override” flag required.
658
659 Repo: https://github.com/readium/readium-css */
660
661/* For AccessibleDfA, we need to normalize font-weight and font-style since only the normal style is available */
662
663:root[style*="readium-font-on"][style*="AccessibleDfA"] {
664 /* We won’t use the variable there since we need fallbacks for missing characters */
665 font-family: AccessibleDfA, Verdana, Tahoma, "Trebuchet MS", sans-serif !important;
666 --RS__lineHeightCompensation: 1.167;
667}
668
669:root[style*="readium-font-on"][style*="IA Writer Duospace"] {
670 /* We won’t use the variable there since we need fallbacks for missing characters */
671 font-family: "IA Writer Duospace", Menlo, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", Courier, monospace !important;
672 --RS__lineHeightCompensation: 1.167;
673}
674
675:root[style*="readium-font-on"][style*="readium-a11y-on"] {
676 font-family: var(--USER__fontFamily) !important;
677 --RS__lineHeightCompensation: 1.167;
678}
679
680/* Maybe users want a setting to normalize any font offered so there is a “a11y Normalize” flag for it */
681
682:root[style*="readium-font-on"][style*="AccessibleDfA"],
683:root[style*="readium-font-on"][style*="IA Writer Duospace"],
684:root[style*="readium-font-on"][style*="readium-a11y-on"] {
685 font-style: normal !important;
686 font-weight: normal !important;
687}
688
689/* Targeting everything except code. Note that Open Dyslexic has a monospaced font for code */
690
691:root[style*="readium-font-on"][style*="AccessibleDfA"] *:not(code):not(var):not(kbd):not(samp),
692:root[style*="readium-font-on"][style*="IA Writer Duospace"] *:not(code):not(var):not(kbd):not(samp),
693:root[style*="readium-font-on"][style*="readium-a11y-on"] *:not(code):not(var):not(kbd):not(samp) {
694 font-family: inherit !important;
695 font-style: inherit !important;
696 font-weight: inherit !important;
697}
698
699/* Normalizing text-decoration, subs and sups */
700
701:root[style*="readium-font-on"][style*="AccessibleDfA"] *,
702:root[style*="readium-font-on"][style*="IA Writer Duospace"] *,
703:root[style*="readium-font-on"][style*="readium-a11y-on"] * {
704 text-decoration: none !important;
705 font-variant-caps: normal !important;
706 font-variant-numeric: normal !important;
707 font-variant-position: normal !important;
708}
709
710:root[style*="readium-font-on"][style*="AccessibleDfA"] sup,
711:root[style*="readium-font-on"][style*="IA Writer Duospace"] sup,
712:root[style*="readium-font-on"][style*="readium-a11y-on"] sup,
713:root[style*="readium-font-on"][style*="AccessibleDfA"] sub,
714:root[style*="readium-font-on"][style*="IA Writer Duospace"] sub,
715:root[style*="readium-font-on"][style*="readium-a11y-on"] sub {
716 font-size: 1rem !important;
717 vertical-align: baseline !important;
718}
719
720/* Readium CSS
721 Font size pref
722
723 A submodule managing font-size for user settings
724 Part of “User Overrides” class – no flag required.
725
726 Repo: https://github.com/readium/readium-css */
727
728:root[style*="--USER__fontSize"] {
729 font-size: var(--USER__fontSize) !important;
730}
731
732/* Readium CSS
733 Line height pref
734
735 A submodule managing line-height for user settings
736 Part of “User Overrides Advanced” class – “advanced settings” flag required.
737
738 Repo: https://github.com/readium/readium-css */
739
740:root[style*="readium-advanced-on"][style*="--USER__lineHeight"] {
741 line-height: var(--USER__lineHeight) !important;
742}
743
744:root[style*="readium-advanced-on"][style*="--USER__lineHeight"] body,
745:root[style*="readium-advanced-on"][style*="--USER__lineHeight"] p,
746:root[style*="readium-advanced-on"][style*="--USER__lineHeight"] li,
747:root[style*="readium-advanced-on"][style*="--USER__lineHeight"] div {
748 line-height: inherit;
749}
750
751/* Readium CSS
752 Para spacing pref
753
754 A submodule managing paragraphs’ top and bottom margins for user settings
755 Part of “User Overrides Advanced” class – “advanced settings” flag required.
756
757 Repo: https://github.com/readium/readium-css */
758
759:root[style*="readium-advanced-on"][style*="--USER__paraSpacing"] p {
760 margin-top: var(--USER__paraSpacing) !important;
761 margin-bottom: var(--USER__paraSpacing) !important;
762}
763
764/* Readium CSS
765 Para indent pref
766
767 A submodule managing paragraphs’ text-indent for user settings
768 Part of “User Overrides Advanced” class – “advanced settings” flag required.
769
770 Repo: https://github.com/readium/readium-css */
771
772:root[style*="readium-advanced-on"][style*="--USER__paraIndent"] p {
773 text-indent: var(--USER__paraIndent) !important;
774}
775
776/* If there are inline-block elements in paragraphs, text-indent will inherit so we must reset it */
777
778:root[style*="readium-advanced-on"][style*="--USER__paraIndent"] p *,
779:root[style*="readium-advanced-on"][style*="--USER__paraIndent"] p:first-letter {
780 text-indent: 0 !important;
781}
782
783/* Readium CSS
784 Word spacing pref
785
786 A submodule managing word-spacing for user settings
787 Part of “User Overrides Advanced” class – “advanced settings” flag required.
788
789 Repo: https://github.com/readium/readium-css */
790
791:root[style*="readium-advanced-on"][style*="--USER__wordSpacing"] h1,
792:root[style*="readium-advanced-on"][style*="--USER__wordSpacing"] h2,
793:root[style*="readium-advanced-on"][style*="--USER__wordSpacing"] h3,
794:root[style*="readium-advanced-on"][style*="--USER__wordSpacing"] h4,
795:root[style*="readium-advanced-on"][style*="--USER__wordSpacing"] h5,
796:root[style*="readium-advanced-on"][style*="--USER__wordSpacing"] h6,
797:root[style*="readium-advanced-on"][style*="--USER__wordSpacing"] p,
798:root[style*="readium-advanced-on"][style*="--USER__wordSpacing"] li,
799:root[style*="readium-advanced-on"][style*="--USER__wordSpacing"] div {
800 word-spacing: var(--USER__wordSpacing);
801}
802
803/* Readium CSS
804 Letter spacing pref
805
806 A submodule managing letter-spacing for user settings
807 Part of “User Overrides Advanced” class – “advanced settings” flag required.
808
809 Repo: https://github.com/readium/readium-css */
810
811:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] h1,
812:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] h2,
813:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] h3,
814:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] h4,
815:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] h5,
816:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] h6,
817:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] p,
818:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] li,
819:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] div {
820 letter-spacing: var(--USER__letterSpacing);
821 font-variant: none;
822}
823
824/* Readium CSS
825 Font size normalize
826
827 A stylesheet to normalize font-size
828
829 Repo: https://github.com/readium/readium-css */
830
831/* STYLES */
832
833/* :root is used so that you can quickly add a class or attribute if you prefer e.g. `:root[data-rs-normalize]` */
834
835/* We create a default so that you don’t need to explicitly set one in the DOM.
836 Once the “Publisher’s styles” checkbox is unchecked, the normalize is applied automatically */
837
838:root[style*="readium-advanced-on"] {
839 --USER__typeScale: 1.2; /* This is the default type scale you’ll find in most publications */
840}
841
842:root[style*="readium-advanced-on"] p,
843:root[style*="readium-advanced-on"] li,
844:root[style*="readium-advanced-on"] div,
845:root[style*="readium-advanced-on"] pre,
846:root[style*="readium-advanced-on"] dd {
847 font-size: 1rem !important;
848}
849
850:root[style*="readium-advanced-on"] h1 {
851 /* Fallback if browser doesn’t support vars */
852 font-size: 1.75rem !important;
853 font-size: calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale)) !important;
854}
855
856:root[style*="readium-advanced-on"] h2 {
857 /* Fallback if browser doesn’t support vars */
858 font-size: 1.5rem !important;
859 font-size: calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) !important;
860}
861
862:root[style*="readium-advanced-on"] h3 {
863 /* Fallback if browser doesn’t support vars */
864 font-size: 1.25rem !important;
865 font-size: calc(1rem * var(--USER__typeScale)) !important;
866}
867
868:root[style*="readium-advanced-on"] h4,
869:root[style*="readium-advanced-on"] h5,
870:root[style*="readium-advanced-on"] h6 {
871 font-size: 1rem !important;
872}
873
874:root[style*="readium-advanced-on"] small {
875 font-size: smaller !important;
876}
877
878:root[style*="readium-advanced-on"] sub,
879:root[style*="readium-advanced-on"] sup {
880 font-size: 67.5% !important;
881}
882
883/* The following styles kick in if you define the typeScale variable in the DOM.
884 No need to repeat declarations which don’t make use of the variable */
885
886:root[style*="readium-advanced-on"][style*="--USER__typeScale"] h1 {
887 font-size: calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale)) !important;
888}
889
890:root[style*="readium-advanced-on"][style*="--USER__typeScale"] h2 {
891 font-size: calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) !important;
892}
893
894:root[style*="readium-advanced-on"][style*="--USER__typeScale"] h3 {
895 font-size: calc(1rem * var(--USER__typeScale)) !important;
896}
897/*# sourceMappingURL=ReadiumCSS-after.css.map */
\No newline at end of file