@readium/navigator 2.2.3 → 2.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/index.js +1565 -1661
  2. package/dist/index.umd.cjs +20 -266
  3. package/package.json +4 -4
  4. package/src/epub/css/Properties.ts +10 -1
  5. package/src/epub/css/ReadiumCSS.ts +3 -0
  6. package/src/epub/frame/FrameBlobBuilder.ts +39 -11
  7. package/src/epub/frame/FrameManager.ts +1 -0
  8. package/src/epub/fxl/FXLFrameManager.ts +1 -0
  9. package/src/epub/preferences/EpubDefaults.ts +8 -2
  10. package/src/epub/preferences/EpubPreferencesEditor.ts +24 -3
  11. package/src/epub/preferences/EpubSettings.ts +6 -2
  12. package/src/preferences/Types.ts +6 -0
  13. package/src/preferences/guards.ts +12 -0
  14. package/src/webpub/WebPubBlobBuilder.ts +17 -8
  15. package/src/webpub/WebPubNavigator.ts +9 -1
  16. package/src/webpub/css/Properties.ts +34 -1
  17. package/src/webpub/css/WebPubCSS.ts +10 -1
  18. package/src/webpub/css/index.ts +1 -2
  19. package/src/webpub/preferences/WebPubDefaults.ts +19 -2
  20. package/src/webpub/preferences/WebPubPreferences.ts +6 -0
  21. package/src/webpub/preferences/WebPubPreferencesEditor.ts +22 -0
  22. package/src/webpub/preferences/WebPubSettings.ts +23 -2
  23. package/types/src/epub/css/Properties.d.ts +3 -1
  24. package/types/src/epub/preferences/EpubDefaults.d.ts +3 -1
  25. package/types/src/epub/preferences/EpubSettings.d.ts +3 -1
  26. package/types/src/preferences/Types.d.ts +14 -0
  27. package/types/src/preferences/guards.d.ts +2 -0
  28. package/types/src/webpub/css/Properties.d.ts +15 -1
  29. package/types/src/webpub/css/WebPubCSS.d.ts +3 -1
  30. package/types/src/webpub/css/index.d.ts +0 -1
  31. package/types/src/webpub/preferences/WebPubDefaults.d.ts +7 -1
  32. package/types/src/webpub/preferences/WebPubPreferences.d.ts +4 -0
  33. package/types/src/webpub/preferences/WebPubPreferencesEditor.d.ts +2 -0
  34. package/types/src/webpub/preferences/WebPubSettings.d.ts +7 -1
  35. package/src/webpub/css/WebPubStylesheet.ts +0 -205
@@ -74,6 +74,28 @@ export class WebPubPreferencesEditor implements IPreferencesEditor {
74
74
  });
75
75
  }
76
76
 
77
+ get iOSPatch(): BooleanPreference {
78
+ return new BooleanPreference({
79
+ initialValue: this.preferences.iOSPatch,
80
+ effectiveValue: this.settings.iOSPatch || false,
81
+ isEffective: true,
82
+ onChange: (newValue: boolean | null | undefined) => {
83
+ this.updatePreference("iOSPatch", newValue || null);
84
+ }
85
+ });
86
+ }
87
+
88
+ get iPadOSPatch(): BooleanPreference {
89
+ return new BooleanPreference({
90
+ initialValue: this.preferences.iPadOSPatch,
91
+ effectiveValue: this.settings.iPadOSPatch || false,
92
+ isEffective: true,
93
+ onChange: (newValue: boolean | null | undefined) => {
94
+ this.updatePreference("iPadOSPatch", newValue || null);
95
+ }
96
+ });
97
+ }
98
+
77
99
  get letterSpacing(): RangePreference<number> {
78
100
  return new RangePreference<number>({
79
101
  initialValue: this.preferences.letterSpacing,
@@ -1,12 +1,16 @@
1
1
  import { ConfigurableSettings } from "../../preferences/Configurable";
2
- import { TextAlignment } from "../../preferences/Types";
2
+ import { ExperimentKey, TextAlignment } from "../../preferences/Types";
3
3
  import { WebPubDefaults } from "./WebPubDefaults";
4
4
  import { WebPubPreferences } from "./WebPubPreferences";
5
5
 
6
+ import { sMLWithRequest } from "../../helpers";
7
+
6
8
  export interface IWebPubSettings {
7
9
  fontFamily?: string | null,
8
10
  fontWeight?: number | null,
9
11
  hyphens?: boolean | null,
12
+ iOSPatch?: boolean | null,
13
+ iPadOSPatch?: boolean | null,
10
14
  letterSpacing?: number | null,
11
15
  ligatures?: boolean | null,
12
16
  lineHeight?: number | null,
@@ -16,13 +20,16 @@ export interface IWebPubSettings {
16
20
  textAlign?: TextAlignment | null,
17
21
  textNormalization?: boolean | null,
18
22
  wordSpacing?: number | null,
19
- zoom?: number | null;
23
+ zoom?: number | null,
24
+ experiments?: Array<ExperimentKey> | null,
20
25
  }
21
26
 
22
27
  export class WebPubSettings implements ConfigurableSettings {
23
28
  fontFamily: string | null = null;
24
29
  fontWeight: number | null = null;
25
30
  hyphens: boolean | null = null;
31
+ iOSPatch: boolean | null = null;
32
+ iPadOSPatch: boolean | null = null;
26
33
  letterSpacing: number | null = null;
27
34
  ligatures: boolean | null = null;
28
35
  lineHeight: number | null = null;
@@ -33,6 +40,7 @@ export class WebPubSettings implements ConfigurableSettings {
33
40
  textNormalization: boolean | null = null;
34
41
  wordSpacing: number | null = null;
35
42
  zoom: number | null;
43
+ experiments: Array<ExperimentKey> | null;
36
44
 
37
45
  constructor(preferences: WebPubPreferences, defaults: WebPubDefaults, hasDisplayTransformability: boolean) {
38
46
  if (hasDisplayTransformability) {
@@ -45,6 +53,16 @@ export class WebPubSettings implements ConfigurableSettings {
45
53
  this.hyphens = typeof preferences.hyphens === "boolean"
46
54
  ? preferences.hyphens
47
55
  : defaults.hyphens ?? null;
56
+ this.iOSPatch = preferences.iOSPatch === false
57
+ ? false
58
+ : preferences.iOSPatch === true
59
+ ? ((sMLWithRequest.OS.iOS || sMLWithRequest.OS.iPadOS) && sMLWithRequest.iOSRequest === "mobile")
60
+ : defaults.iOSPatch;
61
+ this.iPadOSPatch = preferences.iPadOSPatch === false
62
+ ? false
63
+ : preferences.iPadOSPatch === true
64
+ ? (sMLWithRequest.OS.iPadOS && sMLWithRequest.iOSRequest === "desktop")
65
+ : defaults.iPadOSPatch;
48
66
  this.letterSpacing = preferences.letterSpacing !== undefined
49
67
  ? preferences.letterSpacing
50
68
  : defaults.letterSpacing !== undefined
@@ -81,10 +99,13 @@ export class WebPubSettings implements ConfigurableSettings {
81
99
  ? defaults.wordSpacing
82
100
  : null;
83
101
  }
102
+
84
103
  this.zoom = preferences.zoom !== undefined
85
104
  ? preferences.zoom
86
105
  : defaults.zoom !== undefined
87
106
  ? defaults.zoom
88
107
  : null;
108
+
109
+ this.experiments = defaults.experiments || null;
89
110
  }
90
111
  }
@@ -1,4 +1,4 @@
1
- import { TextAlignment } from "../../preferences/Types";
1
+ import { ExperimentKey, TextAlignment } from "../../preferences/Types";
2
2
  import { BodyHyphens, BoxSizing, FontOpticalSizing, FontWidth, Ligatures, Properties, TypeScale, View } from "../../css/Properties";
3
3
  export interface IUserProperties {
4
4
  advancedSettings?: boolean | null;
@@ -113,6 +113,7 @@ export interface IRSProperties {
113
113
  textColor?: string | null;
114
114
  typeScale?: TypeScale | null;
115
115
  visitedColor?: string | null;
116
+ experiments?: Array<ExperimentKey> | null;
116
117
  }
117
118
  export declare class RSProperties extends Properties {
118
119
  backgroundColor: string | null;
@@ -154,6 +155,7 @@ export declare class RSProperties extends Properties {
154
155
  textColor: string | null;
155
156
  typeScale: TypeScale | null;
156
157
  visitedColor: string | null;
158
+ experiments: Array<ExperimentKey> | null;
157
159
  constructor(props: IRSProperties);
158
160
  toCSSProperties(): {
159
161
  [key: string]: string;
@@ -1,4 +1,4 @@
1
- import { TextAlignment } from "../../preferences/Types";
1
+ import { ExperimentKey, TextAlignment } from "../../preferences/Types";
2
2
  export interface IEpubDefaults {
3
3
  backgroundColor?: string | null;
4
4
  blendFilter?: boolean | null;
@@ -38,6 +38,7 @@ export interface IEpubDefaults {
38
38
  textNormalization?: boolean | null;
39
39
  visitedColor?: string | null;
40
40
  wordSpacing?: number | null;
41
+ experiments?: Array<ExperimentKey> | null;
41
42
  }
42
43
  export declare class EpubDefaults {
43
44
  backgroundColor: string | null;
@@ -78,5 +79,6 @@ export declare class EpubDefaults {
78
79
  textNormalization: boolean | null;
79
80
  visitedColor: string | null;
80
81
  wordSpacing: number | null;
82
+ experiments: Array<ExperimentKey> | null;
81
83
  constructor(defaults: IEpubDefaults);
82
84
  }
@@ -1,5 +1,5 @@
1
1
  import { ConfigurableSettings } from "../../preferences/Configurable";
2
- import { TextAlignment } from "../../preferences/Types";
2
+ import { ExperimentKey, TextAlignment } from "../../preferences/Types";
3
3
  import { EpubDefaults } from "./EpubDefaults";
4
4
  import { EpubPreferences } from "./EpubPreferences";
5
5
  export interface IEpubSettings {
@@ -41,6 +41,7 @@ export interface IEpubSettings {
41
41
  textNormalization?: boolean | null;
42
42
  visitedColor?: string | null;
43
43
  wordSpacing?: number | null;
44
+ experiments?: Array<ExperimentKey> | null;
44
45
  }
45
46
  export declare class EpubSettings implements ConfigurableSettings {
46
47
  backgroundColor: string | null;
@@ -81,5 +82,6 @@ export declare class EpubSettings implements ConfigurableSettings {
81
82
  textNormalization: boolean | null;
82
83
  visitedColor: string | null;
83
84
  wordSpacing: number | null;
85
+ experiments: Array<ExperimentKey> | null;
84
86
  constructor(preferences: EpubPreferences, defaults: EpubDefaults);
85
87
  }
@@ -1,3 +1,17 @@
1
+ import RCSSExperiments from "@readium/css/css/vars/experiments.json";
2
+ export type ExperimentKey = keyof typeof RCSSExperiments;
3
+ export declare const experiments: {
4
+ experimentalHeaderFiltering: {
5
+ description: string;
6
+ scope: string;
7
+ value: string;
8
+ };
9
+ experimentalZoom: {
10
+ description: string;
11
+ scope: string;
12
+ value: string;
13
+ };
14
+ };
1
15
  export declare enum TextAlignment {
2
16
  start = "start",
3
17
  left = "left",
@@ -1,3 +1,4 @@
1
+ import { ExperimentKey } from './Types';
1
2
  export declare function ensureLessThanOrEqual<T extends number | null | undefined>(value: T, compareTo: T): T | undefined;
2
3
  export declare function ensureMoreThanOrEqual<T extends number | null | undefined>(value: T, compareTo: T): T | undefined;
3
4
  export declare function ensureString(value: string | null | undefined): string | null | undefined;
@@ -7,3 +8,4 @@ export declare function ensureFilter(filter: boolean | number | null | undefined
7
8
  export declare function ensureNonNegative(value: number | null | undefined): number | null | undefined;
8
9
  export declare function ensureValueInRange(value: number | null | undefined, range: [number, number]): number | null | undefined;
9
10
  export declare function withFallback<T>(value: T | null | undefined, defaultValue: T | null): T | null;
11
+ export declare function ensureExperiment(experimentsInput: ExperimentKey[] | null | undefined): ExperimentKey[] | null | undefined;
@@ -1,10 +1,12 @@
1
- import { TextAlignment } from "../../preferences/Types";
1
+ import { ExperimentKey, TextAlignment } from "../../preferences/Types";
2
2
  import { BodyHyphens, Ligatures, Properties } from "../../css/Properties";
3
3
  export interface IWebUserProperties {
4
4
  a11yNormalize?: boolean | null;
5
5
  bodyHyphens?: BodyHyphens | null;
6
6
  fontFamily?: string | null;
7
7
  fontWeight?: number | null;
8
+ iOSPatch?: boolean | null;
9
+ iPadOSPatch?: boolean | null;
8
10
  letterSpacing?: number | null;
9
11
  ligatures?: Ligatures | null;
10
12
  lineHeight?: number | null;
@@ -20,6 +22,8 @@ export declare class WebUserProperties extends Properties {
20
22
  bodyHyphens: BodyHyphens | null;
21
23
  fontFamily: string | null;
22
24
  fontWeight: number | null;
25
+ iOSPatch: boolean | null;
26
+ iPadOSPatch: boolean | null;
23
27
  letterSpacing: number | null;
24
28
  ligatures: Ligatures | null;
25
29
  lineHeight: number | null;
@@ -34,3 +38,13 @@ export declare class WebUserProperties extends Properties {
34
38
  [key: string]: string;
35
39
  };
36
40
  }
41
+ export interface IWebRSProperties {
42
+ experiments: Array<ExperimentKey> | null;
43
+ }
44
+ export declare class WebRSProperties extends Properties {
45
+ experiments: Array<ExperimentKey> | null;
46
+ constructor(props: IWebRSProperties);
47
+ toCSSProperties(): {
48
+ [key: string]: string;
49
+ };
50
+ }
@@ -1,9 +1,11 @@
1
1
  import { WebPubSettings } from "../preferences/WebPubSettings";
2
- import { WebUserProperties } from "./Properties";
2
+ import { WebRSProperties, WebUserProperties } from "./Properties";
3
3
  export interface IWebPubCSS {
4
+ rsProperties: WebRSProperties;
4
5
  userProperties: WebUserProperties;
5
6
  }
6
7
  export declare class WebPubCSS {
8
+ rsProperties: WebRSProperties;
7
9
  userProperties: WebUserProperties;
8
10
  constructor(props: IWebPubCSS);
9
11
  update(settings: WebPubSettings): void;
@@ -1,3 +1,2 @@
1
1
  export * from "./Properties";
2
2
  export * from "./WebPubCSS";
3
- export * from "./WebPubStylesheet";
@@ -1,8 +1,10 @@
1
- import { TextAlignment } from "../../preferences/Types";
1
+ import { ExperimentKey, TextAlignment } from "../../preferences/Types";
2
2
  export interface IWebPubDefaults {
3
3
  fontFamily?: string | null;
4
4
  fontWeight?: number | null;
5
5
  hyphens?: boolean | null;
6
+ iOSPatch?: boolean | null;
7
+ iPadOSPatch?: boolean | null;
6
8
  letterSpacing?: number | null;
7
9
  ligatures?: boolean | null;
8
10
  lineHeight?: number | null;
@@ -13,11 +15,14 @@ export interface IWebPubDefaults {
13
15
  textNormalization?: boolean | null;
14
16
  wordSpacing?: number | null;
15
17
  zoom?: number | null;
18
+ experiments?: Array<ExperimentKey> | null;
16
19
  }
17
20
  export declare class WebPubDefaults {
18
21
  fontFamily: string | null;
19
22
  fontWeight: number | null;
20
23
  hyphens: boolean | null;
24
+ iOSPatch: boolean | null;
25
+ iPadOSPatch: boolean | null;
21
26
  letterSpacing: number | null;
22
27
  ligatures: boolean | null;
23
28
  lineHeight: number | null;
@@ -28,5 +33,6 @@ export declare class WebPubDefaults {
28
33
  textNormalization: boolean | null;
29
34
  wordSpacing: number | null;
30
35
  zoom: number;
36
+ experiments: Array<ExperimentKey> | null;
31
37
  constructor(defaults: IWebPubDefaults);
32
38
  }
@@ -4,6 +4,8 @@ export interface IWebPubPreferences {
4
4
  fontFamily?: string | null;
5
5
  fontWeight?: number | null;
6
6
  hyphens?: boolean | null;
7
+ iOSPatch?: boolean | null;
8
+ iPadOSPatch?: boolean | null;
7
9
  letterSpacing?: number | null;
8
10
  ligatures?: boolean | null;
9
11
  lineHeight?: number | null;
@@ -19,6 +21,8 @@ export declare class WebPubPreferences implements ConfigurablePreferences {
19
21
  fontFamily?: string | null;
20
22
  fontWeight?: number | null;
21
23
  hyphens?: boolean | null;
24
+ iOSPatch?: boolean | null;
25
+ iPadOSPatch?: boolean | null;
22
26
  letterSpacing?: number | null;
23
27
  ligatures?: boolean | null;
24
28
  lineHeight?: number | null;
@@ -15,6 +15,8 @@ export declare class WebPubPreferencesEditor implements IPreferencesEditor {
15
15
  get fontFamily(): Preference<string>;
16
16
  get fontWeight(): RangePreference<number>;
17
17
  get hyphens(): BooleanPreference;
18
+ get iOSPatch(): BooleanPreference;
19
+ get iPadOSPatch(): BooleanPreference;
18
20
  get letterSpacing(): RangePreference<number>;
19
21
  get ligatures(): BooleanPreference;
20
22
  get lineHeight(): RangePreference<number>;
@@ -1,11 +1,13 @@
1
1
  import { ConfigurableSettings } from "../../preferences/Configurable";
2
- import { TextAlignment } from "../../preferences/Types";
2
+ import { ExperimentKey, TextAlignment } from "../../preferences/Types";
3
3
  import { WebPubDefaults } from "./WebPubDefaults";
4
4
  import { WebPubPreferences } from "./WebPubPreferences";
5
5
  export interface IWebPubSettings {
6
6
  fontFamily?: string | null;
7
7
  fontWeight?: number | null;
8
8
  hyphens?: boolean | null;
9
+ iOSPatch?: boolean | null;
10
+ iPadOSPatch?: boolean | null;
9
11
  letterSpacing?: number | null;
10
12
  ligatures?: boolean | null;
11
13
  lineHeight?: number | null;
@@ -16,11 +18,14 @@ export interface IWebPubSettings {
16
18
  textNormalization?: boolean | null;
17
19
  wordSpacing?: number | null;
18
20
  zoom?: number | null;
21
+ experiments?: Array<ExperimentKey> | null;
19
22
  }
20
23
  export declare class WebPubSettings implements ConfigurableSettings {
21
24
  fontFamily: string | null;
22
25
  fontWeight: number | null;
23
26
  hyphens: boolean | null;
27
+ iOSPatch: boolean | null;
28
+ iPadOSPatch: boolean | null;
24
29
  letterSpacing: number | null;
25
30
  ligatures: boolean | null;
26
31
  lineHeight: number | null;
@@ -31,5 +36,6 @@ export declare class WebPubSettings implements ConfigurableSettings {
31
36
  textNormalization: boolean | null;
32
37
  wordSpacing: number | null;
33
38
  zoom: number | null;
39
+ experiments: Array<ExperimentKey> | null;
34
40
  constructor(preferences: WebPubPreferences, defaults: WebPubDefaults, hasDisplayTransformability: boolean);
35
41
  }
@@ -1,205 +0,0 @@
1
- // WebPubCSS is equivalent to ReadiumCSS for WebPub
2
- // Respects the stylesheet order from after
3
-
4
- export const webPubStylesheet = `
5
- /* TextAlign */
6
-
7
- :root[style*="--USER__textAlign"] {
8
- text-align: var(--USER__textAlign);
9
- }
10
-
11
- :root[style*="--USER__textAlign"] body,
12
- :root[style*="--USER__textAlign"] p:not([class*="title"]):not(blockquote p):not(figcaption p):not(header p):not(hgroup p):not(div:has(+ *) > h1 + p):not(div:has(+ *) > p:has(+ h1)),
13
- :root[style*="--USER__textAlign"] li,
14
- :root[style*="--USER__textAlign"] dd {
15
- text-align: var(--USER__textAlign) !important;
16
- -moz-text-align-last: auto !important;
17
- -epub-text-align-last: auto !important;
18
- text-align-last: auto !important;
19
- }
20
-
21
- /* Hyphens */
22
-
23
- :root[style*="--USER__bodyHyphens"] {
24
- -webkit-hyphens: var(--USER__bodyHyphens) !important;
25
- -moz-hyphens: var(--USER__bodyHyphens) !important;
26
- -ms-hyphens: var(--USER__bodyHyphens) !important;
27
- -epub-hyphens: var(--USER__bodyHyphens) !important;
28
- hyphens: var(--USER__bodyHyphens) !important;
29
- }
30
-
31
- :root[style*="--USER__bodyHyphens"] body,
32
- :root[style*="--USER__bodyHyphens"] p,
33
- :root[style*="--USER__bodyHyphens"] li,
34
- :root[style*="--USER__bodyHyphens"] div,
35
- :root[style*="--USER__bodyHyphens"] dd {
36
- -webkit-hyphens: inherit;
37
- -moz-hyphens: inherit;
38
- -ms-hyphens: inherit;
39
- -epub-hyphens: inherit;
40
- hyphens: inherit;
41
- }
42
-
43
- /* FontFamily */
44
-
45
- :root[style*="--USER__fontFamily"] {
46
- font-family: var(--USER__fontFamily) !important;
47
- }
48
-
49
- :root[style*="--USER__fontFamily"] * {
50
- font-family: revert !important;
51
- }
52
-
53
- /* TextNormalize */
54
-
55
- :root[style*="readium-a11y-on"] {
56
- font-weight: normal !important;
57
- font-style: normal !important;
58
- }
59
-
60
- :root[style*="readium-a11y-on"] body *:not(code):not(var):not(kbd):not(samp) {
61
- font-family: inherit !important;
62
- font-weight: inherit !important;
63
- font-style: inherit !important;
64
- }
65
-
66
- :root[style*="readium-a11y-on"] body * {
67
- text-decoration: none !important;
68
- font-variant-caps: normal !important;
69
- font-variant-position: normal !important;
70
- font-variant-numeric: normal !important;
71
- }
72
-
73
- :root[style*="readium-a11y-on"] sup,
74
- :root[style*="readium-a11y-on"] sub {
75
- font-size: 1rem !important;
76
- vertical-align: baseline !important;
77
- }
78
-
79
- /* Zoom */
80
-
81
- :root {
82
- --USER__zoom: 1;
83
- }
84
-
85
- :root[style*="--USER__zoom"] body {
86
- zoom: var(--USER__zoom) !important;
87
- }
88
-
89
- @supports selector(figure:has(> img)) {
90
- :root[style*="--USER__zoom"] figure:has(> img),
91
- :root[style*="--USER__zoom"] figure:has(> video),
92
- :root[style*="--USER__zoom"] figure:has(> svg),
93
- :root[style*="--USER__zoom"] figure:has(> canvas),
94
- :root[style*="--USER__zoom"] figure:has(> iframe),
95
- :root[style*="--USER__zoom"] figure:has(> audio),
96
- :root[style*="--USER__zoom"] div:has(> img),
97
- :root[style*="--USER__zoom"] div:has(> video),
98
- :root[style*="--USER__zoom"] div:has(> svg),
99
- :root[style*="--USER__zoom"] div:has(> canvas),
100
- :root[style*="--USER__zoom"] div:has(> iframe),
101
- :root[style*="--USER__zoom"] div:has(> audio),
102
- :root[style*="--USER__zoom"] table {
103
- zoom: calc(100% / var(--USER__zoom)) !important;
104
- }
105
-
106
- :root[style*="--USER__zoom"] figcaption,
107
- :root[style*="--USER__zoom"] caption,
108
- :root[style*="--USER__zoom"] td,
109
- :root[style*="--USER__zoom"] th {
110
- zoom: var(--USER__zoom) !important;
111
- }
112
- }
113
-
114
- /* LineHeight */
115
-
116
- :root[style*="--USER__lineHeight"] {
117
- line-height: var(--USER__lineHeight) !important;
118
- }
119
-
120
- :root[style*="--USER__lineHeight"] body,
121
- :root[style*="--USER__lineHeight"] p,
122
- :root[style*="--USER__lineHeight"] li,
123
- :root[style*="--USER__lineHeight"] div {
124
- line-height: inherit;
125
- }
126
-
127
- /* ParagraphSpacing */
128
-
129
- :root[style*="--USER__paraSpacing"] p {
130
- margin-block: var(--USER__paraSpacing) !important;
131
- }
132
-
133
- /* ParagraphIndent */
134
-
135
- :root[style*="--USER__paraIndent"] p {
136
- text-indent: var(--USER__paraIndent) !important;
137
- }
138
-
139
- :root[style*="--USER__paraIndent"] p *,
140
- :root[style*="--USER__paraIndent"] p:first-letter {
141
- text-indent: 0 !important;
142
- }
143
-
144
- /* WordSpacing */
145
-
146
- :root[style*="--USER__wordSpacing"] h1,
147
- :root[style*="--USER__wordSpacing"] h2,
148
- :root[style*="--USER__wordSpacing"] h3,
149
- :root[style*="--USER__wordSpacing"] h4,
150
- :root[style*="--USER__wordSpacing"] h5,
151
- :root[style*="--USER__wordSpacing"] h6,
152
- :root[style*="--USER__wordSpacing"] p,
153
- :root[style*="--USER__wordSpacing"] li,
154
- :root[style*="--USER__wordSpacing"] div,
155
- :root[style*="--USER__wordSpacing"] dt,
156
- :root[style*="--USER__wordSpacing"] dd {
157
- word-spacing: var(--USER__wordSpacing);
158
- }
159
-
160
- /* LetterSpacing */
161
-
162
- :root[style*="--USER__letterSpacing"] h1,
163
- :root[style*="--USER__letterSpacing"] h2,
164
- :root[style*="--USER__letterSpacing"] h3,
165
- :root[style*="--USER__letterSpacing"] h4,
166
- :root[style*="--USER__letterSpacing"] h5,
167
- :root[style*="--USER__letterSpacing"] h6,
168
- :root[style*="--USER__letterSpacing"] p,
169
- :root[style*="--USER__letterSpacing"] li,
170
- :root[style*="--USER__letterSpacing"] div,
171
- :root[style*="--USER__letterSpacing"] dt,
172
- :root[style*="--USER__letterSpacing"] dd {
173
- letter-spacing: var(--USER__letterSpacing);
174
- font-variant: none;
175
- }
176
-
177
- /* FontWeight */
178
-
179
- :root[style*="--USER__fontWeight"] body {
180
- font-weight: var(--USER__fontWeight) !important;
181
- }
182
-
183
- /* Attempt to handle known bolds */
184
- :root[style*="--USER__fontWeight"] b,
185
- :root[style*="--USER__fontWeight"] strong {
186
- font-weight: bolder;
187
- }
188
-
189
- /* Ruby */
190
-
191
- :root[style*="readium-noRuby-on"] body rt,
192
- :root[style*="readium-noRuby-on"] body rp {
193
- display: none;
194
- }
195
-
196
- /* Ligatures */
197
-
198
- :root[style*="--USER__ligatures"] {
199
- font-variant-ligatures: var(--USER__ligatures) !important;
200
- }
201
-
202
- :root[style*="--USER__ligatures"] * {
203
- font-variant-ligatures: inherit !important;
204
- }
205
- `;