|
50 | 50 | <section id="setting" class="level4"> |
51 | 51 | <h4 class="sigil_not_in_toc">Setting</h4> |
52 | 52 |
|
53 | | - <pre><code>var root = document.documentElement; root.style.setProperty("name of var", "value");</code></pre> |
| 53 | + <pre><code>var root = document.documentElement; |
| 54 | +root.style.setProperty("name of var", "value");</code></pre> |
54 | 55 |
|
55 | 56 | <p>You don’t need to remove the variable before setting another value, the new value will simply override the existing one.</p> |
56 | 57 | </section> |
57 | 58 |
|
58 | 59 | <section id="removing" class="level4"> |
59 | 60 | <h4 class="sigil_not_in_toc">Removing</h4> |
60 | 61 |
|
61 | | - <pre><code>var root = document.documentElement; root.style.removeProperty("name of var");</code></pre> |
| 62 | + <p>You can either remove the style explicitly with <code>removeProperty()</code>:</p> |
| 63 | + |
| 64 | + <pre><code>var root = document.documentElement; |
| 65 | +root.style.removeProperty("name of var");</code></pre> |
| 66 | + |
| 67 | + <p>Or implicitly by using an empty string as a value with <code>setProperty()</code>:</p> |
| 68 | + |
| 69 | + <pre><code>var root = document.documentElement; |
| 70 | +root.style.setProperty("name of var", "");</code></pre> |
| 71 | + |
| 72 | + <p>Setting a property with an empty string as the value will indeed invoke <code>removeProperty()</code>, as defined in the <a href="https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty">CSS Object Model Spec</a>.</p> |
62 | 73 | </section> |
63 | 74 | </section> |
64 | 75 | </section> |
|
68 | 79 |
|
69 | 80 | <p>Some variables behave like flags. You could also use custom <code>data-*</code> attributes or CSS classes to manage the following ones. See the <a href="../Text/Section-002.xhtml">“Quickstart” doc</a> for customization.</p> |
70 | 81 |
|
| 82 | + <p>By default, those flags are not set. Then their initialization depends on your user settings’ management e.g. apply user settings to all EPUBs, only the ones that have already been customized, etc.</p> |
| 83 | + |
71 | 84 | <section id="user-view" class="level3"> |
72 | 85 | <h3 class="sigil_not_in_toc">User view</h3> |
73 | 86 |
|
74 | 87 | <p>Allows to switch between paged and scroll view.</p> |
75 | 88 |
|
76 | 89 | <pre><code>--USER__view</code></pre> |
77 | 90 |
|
78 | | - <p>Possible values: <code>readium-paged-on</code> | <code>readium-scroll-on</code></p> |
| 91 | + <p>Supported values: <code>readium-paged-on</code> | <code>readium-scroll-on</code></p> |
79 | 92 |
|
80 | 93 | <p>Override class: Chrome (should be applied by any means necessary)</p> |
| 94 | + |
| 95 | + <p>If the flag is not set, ReadiumCSS will fall back to the paged view.</p> |
81 | 96 | </section> |
82 | 97 |
|
83 | 98 | <section id="font-family-override" class="level3"> |
|
87 | 102 |
|
88 | 103 | <pre><code>--USER__fontOverride</code></pre> |
89 | 104 |
|
90 | | - <p>Possible values: <code>readium-font-on</code> | <code>readium-font-off</code></p> |
| 105 | + <p>Supported value: <code>readium-font-on</code></p> |
91 | 106 |
|
92 | 107 | <p>Override class: None. This flag is required to change the <code>font-family</code> user setting.</p> |
93 | 108 |
|
94 | | - <p>To switch back to the publisher’s font, you can either change the value to <code>readium-font-off</code> or remove the flag.</p> |
| 109 | + <p>To switch back to the publisher’s font, you can either set an empty string as a value or remove the property.</p> |
95 | 110 | </section> |
96 | 111 |
|
97 | 112 | <section id="advanced-settings" class="level3"> |
|
103 | 118 |
|
104 | 119 | <pre><code>--USER__advancedSettings</code></pre> |
105 | 120 |
|
106 | | - <p>Possible values: <code>readium-advanced-on</code> | <code>readium-advanced-off</code></p> |
| 121 | + <p>Supported value: <code>readium-advanced-on</code></p> |
107 | 122 |
|
108 | 123 | <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> |
109 | 124 |
|
110 | | - <p>To switch back to the publisher’s styles, you can either change the value to <code>readium-advanced-off</code> or remove it. This will disable all advanced settings requiring the flag.</p> |
| 125 | + <p>To switch back to the publisher’s styles, you can either set an empty string as a value or remove the property. This will disable all advanced settings requiring the flag.</p> |
111 | 126 | </section> |
112 | 127 |
|
113 | 128 | <section id="reading-modes" class="level3"> |
|
117 | 132 |
|
118 | 133 | <pre><code>--USER__appearance</code></pre> |
119 | 134 |
|
120 | | - <p>Possible values: <code>readium-day-on</code> | <code>readium-sepia-on</code> | <code>readium-night-on</code></p> |
| 135 | + <p>Supported values: <code>readium-day-on</code> | <code>readium-sepia-on</code> | <code>readium-night-on</code></p> |
121 | 136 |
|
122 | 137 | <p>Override class: Chrome (should be applied by any means necessary)</p> |
| 138 | + |
| 139 | + <p>If the flag is not set, ReadiumCSS will fall back to the day mode.</p> |
123 | 140 | </section> |
124 | 141 |
|
125 | 142 | <section id="filters" class="level3"> |
|
129 | 146 |
|
130 | 147 | <pre><code>--USER__darkenFilter</code></pre> |
131 | 148 |
|
132 | | - <p>Possible values: <code>readium-darken-on</code> | <code>readium-darken-off</code></p> |
| 149 | + <p>Supported value: <code>readium-darken-on</code></p> |
133 | 150 |
|
134 | 151 | <p>Override class: Chrome advanced (optional but should be applied by any means necessary if provided to users)</p> |
135 | 152 |
|
| 153 | + <p>To disable the filter, you can either set an empty string as a value or remove the property.</p> |
| 154 | + |
136 | 155 | <pre><code>--USER__invertFilter</code></pre> |
137 | 156 |
|
138 | | - <p>Possible values: <code>readium-invert-on</code> | <code>readium-invert-off</code></p> |
| 157 | + <p>Supported value: <code>readium-invert-on</code></p> |
139 | 158 |
|
140 | 159 | <p>Override class: Chrome advanced (optional but should be applied by any means necessary if provided to users)</p> |
| 160 | + |
| 161 | + <p>To disable the filter, you can either set an empty string as a value or remove the property.</p> |
141 | 162 | </section> |
142 | 163 |
|
143 | 164 | <section id="accessibility-normalization" class="level3"> |
|
147 | 168 |
|
148 | 169 | <pre><code>--USER__a11yNormalize</code></pre> |
149 | 170 |
|
150 | | - <p>Possible values: <code>readium-a11y-on</code> | <code>readium-a11y-off</code></p> |
| 171 | + <p>Supported value: <code>readium-a11y-on</code></p> |
151 | 172 |
|
152 | 173 | <p>Required flag: <code>--USER__fontOverride: readium-font-on</code></p> |
153 | 174 |
|
154 | 175 | <p>Override class: User settings advanced (optional but should be applied by any means necessary if provided to users)</p> |
| 176 | + |
| 177 | + <p>To disable the normalization, you can either set an empty string as a value or remove the property.</p> |
155 | 178 | </section> |
156 | 179 | </section> |
157 | 180 |
|
|
0 commit comments