Skip to content

Commit 91eee9a

Browse files
committed
Reword/Improve API doc
Re #78
1 parent 52264bb commit 91eee9a

4 files changed

Lines changed: 55 additions & 53 deletions

File tree

docs/CSS19-api.md

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
[Implementers’ doc]
44

5+
This document is meant to list all the customizable medias and flags (to be found in `ReadiumCSS-config.css`), as well as all the CSS variables for Reading System and User styles available in the `dist` stylesheets.
6+
57
As a reminder, the priority is, in general:
68

79
```
@@ -30,6 +32,8 @@ root.style.removeProperty("--USER__var");
3032

3133
## Customizable medias
3234

35+
You will find those customizable medias in `ReadiumCSS-config.css`. The values defined are used in media queries to control use of the auto pagination model.
36+
3337
* * *
3438

3539
```
@@ -66,21 +70,33 @@ The maximum device width of the mobile device for which the auto pagination mode
6670

6771
## Customizable flags
6872

69-
Those custom selectors can be customized before runtime. Check the [“Quickstart” doc](../docs/CSS02-quickstart.md) for further details.
73+
You will find those customizable flags in `ReadiumCSS-config.css`, and can think of the preset values as boolean inline styles: if they are set on the `:root` element (i.e. `html`) then the flag is enabled. If another value is, or they are removed, then the flag is disabled.
74+
75+
Those custom selectors can only be customized before runtime. You could for example use a class or a custom attribute instead of an inline style. Check the [“User Preferences”](../docs/CSS12-user_prefs.md#flags) and [“Quickstart”](../docs/CSS02-quickstart.md) docs for further details.
7076

71-
The “dummy CSS variable” is a recommended CSS custom property name you can use to set the default value if you don’t customize those selectors and just keep the default.
77+
**Note:** The preset is not a default implementers should use. Indeed, the initialization of those flags depends on your user settings’ management e.g. apply user settings to all EPUBs, only the ones that have already been customized, etc.
7278

7379
* * *
7480

7581
```
76-
:--scroll-view
82+
:--paged-view
7783
```
7884

79-
Default is `readium-scroll-on`
85+
Preset: `--USER__view: readium-paged-on`
8086

8187
Scope: `html`
8288

83-
Dummy CSS variable: `--USER__view`
89+
Override class: Chrome (should be applied by any means necessary)
90+
91+
* * *
92+
93+
```
94+
:--scroll-view
95+
```
96+
97+
Preset: `--USER__view: readium-scroll-on`
98+
99+
Scope: `html`
84100

85101
Override class: Chrome (should be applied by any means necessary)
86102

@@ -90,12 +106,10 @@ Override class: Chrome (should be applied by any means necessary)
90106
:--font-override
91107
```
92108

93-
Default is `readium-font-on`
109+
Preset: `--USER__fontOverride: readium-font-on`
94110

95111
Scope: `html`
96112

97-
Dummy CSS variable: `--USER__fontOverride`
98-
99113
Override class: None. This flag is required to change the `font-family` user setting.
100114

101115
* * *
@@ -104,12 +118,10 @@ Override class: None. This flag is required to change the `font-family` user set
104118
:--advanced-settings
105119
```
106120

107-
Default is `readium-advanced-on`
121+
Preset: `--USER__advancedSettings: readium-advanced-on`
108122

109123
Scope: `html`
110124

111-
Dummy CSS variable: `--USER__advancedSettings`
112-
113125
Override class: None. This flag is required to apply the `font-family`, the `font-size` and/or advanced user settings.
114126

115127
* * *
@@ -118,12 +130,10 @@ Override class: None. This flag is required to apply the `font-family`, the `fon
118130
:--sepia-mode
119131
```
120132

121-
Default is `readium-sepia-on`
133+
Preset: `--USER__appearance: readium-sepia-on`
122134

123135
Scope: `html`
124136

125-
Dummy CSS variable: `--USER__appearance`
126-
127137
Override class: Chrome (should be applied by any means necessary)
128138

129139
This flag applies the sepia reading mode.
@@ -134,12 +144,10 @@ This flag applies the sepia reading mode.
134144
:--night-mode
135145
```
136146

137-
Default is `readium-night-on`
147+
Preset: `--USER__appearance: readium-night-on`
138148

139149
Scope: `html`
140150

141-
Dummy CSS variable: `--USER__appearance`
142-
143151
Override class: Chrome (should be applied by any means necessary)
144152

145153
This flag applies the night reading mode.
@@ -150,12 +158,10 @@ This flag applies the night reading mode.
150158
:--darken-filter
151159
```
152160

153-
Default is `readium-darken-on`
161+
Preset: `--USER__darkenImages: readium-darken-on`
154162

155163
Scope: `html`
156164

157-
Dummy CSS variable: `--USER__darkenImages`
158-
159165
Override class: Chrome advanced (optional but should be applied by any means necessary if provided to users)
160166

161167
This will only apply in night mode to darken images and impact `img`.
@@ -166,12 +172,10 @@ This will only apply in night mode to darken images and impact `img`.
166172
:--invert-filter
167173
```
168174

169-
Default is `readium-invert-on`
175+
Preset: `--USER__invertImages: readium-invert-on`
170176

171177
Scope: `html`
172178

173-
Dummy CSS variable: `--USER__invertImages`
174-
175179
Override class: Chrome advanced (optional but should be applied by any means necessary if provided to users)
176180

177181
This will only apply in night mode to invert images and impact `img`.
@@ -182,12 +186,10 @@ This will only apply in night mode to invert images and impact `img`.
182186
:--a11y-normalize
183187
```
184188

185-
Default is `readium-a11y-on`
189+
Preset: `--USER__a11yNormalize: readium-a11y-on`
186190

187191
Scope: `html`
188192

189-
Dummy CSS variable: `--USER__a11yNormalize`
190-
191193
Required flag: `:--fontOverride`
192194

193195
Override class: User settings advanced (optional but should be applied by any means necessary if provided to users)

docs/ReadiumCSS_docs.epub

-631 Bytes
Binary file not shown.

docs/ReadiumCSS_docs/OEBPS/Text/Section-019.xhtml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
<p>[Implementers’ doc]</p>
1717

18+
<p>This document is meant to list all the customizable medias and flags (to be found in <code>ReadiumCSS-config.css</code>), as well as all the CSS variables for Reading System and User styles available in the <code>dist</code> stylesheets.</p>
19+
1820
<p>As a reminder, the priority is, in general:</p>
1921

2022
<pre><code>USER &gt; AUTHOR &gt; RS</code></pre>
@@ -40,6 +42,8 @@
4042
<section id="customizable-medias" class="level2">
4143
<h2 id="sigil_toc_id_183">Customizable medias</h2>
4244

45+
<p>You will find those customizable medias in <code>ReadiumCSS-config.css</code>. The values defined are used in media queries to control use of the auto pagination model.</p>
46+
4347
<hr/>
4448

4549
<pre><code>--responsive-columns</code></pre>
@@ -72,56 +76,60 @@
7276
<section id="customizable-flags" class="level2">
7377
<h2 id="sigil_toc_id_184">Customizable flags</h2>
7478

75-
<p>Those custom selectors can be customized before runtime. Check the <a href="../Text/Section-002.xhtml">“Quickstart” doc</a> for further details.</p>
79+
<p>You will find those customizable flags in <code>ReadiumCSS-config.css</code>, and can think of the preset values as boolean inline styles: if they are set on the <code>:root</code> element (i.e. <code>html</code>) then the flag is enabled. If another value is, or they are removed, then the flag is disabled.</p>
80+
81+
<p>Those custom selectors can only be customized before runtime. You could for example use a class or a custom attribute instead of an inline style. Check the <a href="../Text/Section-012.xhtml#sigil_toc_id_177">“User Settings”</a> and <a href="../Text/Section-002.xhtml">“Quickstart”</a> docs for further details.</p>
7682

77-
<p>The “dummy CSS variable” is a recommended CSS custom property name you can use to set the default value if you don’t customize those selectors and just keep the default.</p>
83+
<p><strong>Note:</strong> The preset is not a default implementers should use. Indeed, the initialization of those flags depends on your user settings’ management e.g. apply user settings to all EPUBs, only the ones that have already been customized, etc.</p>
7884

7985
<hr/>
8086

81-
<pre><code>:--scroll-view</code></pre>
87+
<pre><code>:--paged-view</code></pre>
8288

83-
<p>Default is <code>readium-scroll-on</code></p>
89+
<p>Preset: <code>--USER__view: readium-paged-on</code></p>
8490

8591
<p>Scope: <code>html</code></p>
8692

87-
<p>Dummy CSS variable: <code>--USER__view</code></p>
93+
<p>Override class: Chrome (should be applied by any means necessary)</p>
94+
95+
<hr/>
96+
97+
<pre><code>:--scroll-view</code></pre>
98+
99+
<p>Preset: <code>--USER__view: readium-scroll-on</code></p>
100+
101+
<p>Scope: <code>html</code></p>
88102

89103
<p>Override class: Chrome (should be applied by any means necessary)</p>
90104

91105
<hr/>
92106

93107
<pre><code>:--font-override</code></pre>
94108

95-
<p>Default is <code>readium-font-on</code></p>
109+
<p>Preset: <code>--USER__fontOverride: readium-font-on</code></p>
96110

97111
<p>Scope: <code>html</code></p>
98112

99-
<p>Dummy CSS variable: <code>--USER__fontOverride</code></p>
100-
101113
<p>Override class: None. This flag is required to change the <code>font-family</code> user setting.</p>
102114

103115
<hr/>
104116

105117
<pre><code>:--advanced-settings</code></pre>
106118

107-
<p>Default is <code>readium-advanced-on</code></p>
119+
<p>Preset: <code>--USER__advancedSettings: readium-advanced-on</code></p>
108120

109121
<p>Scope: <code>html</code></p>
110122

111-
<p>Dummy CSS variable: <code>--USER__advancedSettings</code></p>
112-
113123
<p>Override class: None. This flag is required to apply the <code>font-family</code>, the <code>font-size</code> and/or advanced user settings.</p>
114124

115125
<hr/>
116126

117127
<pre><code>:--sepia-mode</code></pre>
118128

119-
<p>Default is <code>readium-sepia-on</code></p>
129+
<p>Preset: <code>--USER__appearance: readium-sepia-on</code></p>
120130

121131
<p>Scope: <code>html</code></p>
122132

123-
<p>Dummy CSS variable: <code>--USER__appearance</code></p>
124-
125133
<p>Override class: Chrome (should be applied by any means necessary)</p>
126134

127135
<p>This flag applies the sepia reading mode.</p>
@@ -130,12 +138,10 @@
130138

131139
<pre><code>:--night-mode</code></pre>
132140

133-
<p>Default is <code>readium-night-on</code></p>
141+
<p>Preset: <code>--USER__appearance: readium-night-on</code></p>
134142

135143
<p>Scope: <code>html</code></p>
136144

137-
<p>Dummy CSS variable: <code>--USER__appearance</code></p>
138-
139145
<p>Override class: Chrome (should be applied by any means necessary)</p>
140146

141147
<p>This flag applies the night reading mode.</p>
@@ -144,12 +150,10 @@
144150

145151
<pre><code>:--darken-filter</code></pre>
146152

147-
<p>Default is <code>readium-darken-on</code></p>
153+
<p>Preset: <code>--USER__darkenImages: readium-darken-on</code></p>
148154

149155
<p>Scope: <code>html</code></p>
150156

151-
<p>Dummy CSS variable: <code>--USER__darkenImages</code></p>
152-
153157
<p>Override class: Chrome advanced (optional but should be applied by any means necessary if provided to users)</p>
154158

155159
<p>This will only apply in night mode to darken images and impact <code>img</code>.</p>
@@ -158,12 +162,10 @@
158162

159163
<pre><code>:--invert-filter</code></pre>
160164

161-
<p>Default is <code>readium-invert-on</code></p>
165+
<p>Preset: <code>--USER__invertImages: readium-invert-on</code></p>
162166

163167
<p>Scope: <code>html</code></p>
164168

165-
<p>Dummy CSS variable: <code>--USER__invertImages</code></p>
166-
167169
<p>Override class: Chrome advanced (optional but should be applied by any means necessary if provided to users)</p>
168170

169171
<p>This will only apply in night mode to invert images and impact <code>img</code>.</p>
@@ -172,12 +174,10 @@
172174

173175
<pre><code>:--a11y-normalize</code></pre>
174176

175-
<p>Default is <code>readium-a11y-on</code></p>
177+
<p>Preset: <code>--USER__a11yNormalize: readium-a11y-on</code></p>
176178

177179
<p>Scope: <code>html</code></p>
178180

179-
<p>Dummy CSS variable: <code>--USER__a11yNormalize</code></p>
180-
181181
<p>Required flag: <code>:--fontOverride</code></p>
182182

183183
<p>Override class: User settings advanced (optional but should be applied by any means necessary if provided to users)</p>

docs/ReadiumCSS_docs/OEBPS/content.opf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<dc:language>en</dc:language>
99
<dc:identifier id="epub-id-1">urn:uuid:91cab77e-946f-4814-9e61-8494a5d5cb0f</dc:identifier>
1010
<meta name="cover" content="cover_jpg"/>
11-
<meta property="dcterms:modified">2019-11-28T14:00:00Z</meta>
11+
<meta property="dcterms:modified">2020-03-09T16:47:28Z</meta>
1212
<meta content="0.9.5" name="Sigil version"/>
1313
<meta property="schema:accessibilityFeature">displayTransformability</meta>
1414
<meta property="schema:accessibilityFeature">readingOrder</meta>

0 commit comments

Comments
 (0)