You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Features that were considered but not implemented
2
+
3
+
[Implementers’ doc][WIP]
4
+
5
+
This document aims to list features that were considered but not implemented in ReadiumCSS, and clarify the reasons why they weren’t.
6
+
7
+
It is important to highlight that in most cases, features were not implemented because ReadiumCSS wasn’t the best way to handle them, not because they didn’t have strong use cases. If they were considered for implementation in the first place it is because they were useful, but ReadiumCSS couldn’t really implement them properly, or would have created issues for app developers, etc.
8
+
9
+
In other words, this document may also serve as a list of features you could choose to contribute in the various [Readium SDKs and test apps](https://github.com/readium) if they aren’t already implemented.
10
+
11
+
## Alternate background colors for lines (A11Y)
12
+
13
+
Related issue: [#39](https://github.com/readium/readium-css/issues/39)
14
+
15
+
The idea was to add an alternate `background-color` to each line. Since CSS doesn’t have any concept of `nth-line`, you have to cheat and use a `linear-gradient` switching colors based on the current `line-height`.
16
+
17
+
Unfortunately, this doesn’t work well with fragmentation, and the linear gradient quickly becomes offset.
18
+
19
+

20
+
21
+
In addition, CSS is too limited to handle more complex cases such as images and, more generally, more complex structures. So you need JS for a good enough implementation.
22
+
23
+
## Contrasting text against backgrounds in custom user themes
24
+
25
+
Related issue: [#74](https://github.com/readium/readium-css/issues/74)
26
+
27
+
The idea was to handle the text color (using the `calc()` function) when the user picks a background color in custom themes. For instance, text would have been automatically inverted (white instead of black) with a dark background. Obviously, that wouldn’t have prevented the user from picking another text color.
28
+
29
+
However, implementing this feature in ReadiumCSS would have made it unpredictable for app developers. Indeed, it would have made it difficult for them to synchronize the User Interface, and label the correct text color as active.
30
+
31
+
This feature should therefore be implemented in the app, as part of the custom themes component.
32
+
33
+
## Handle day/night theme based on OSs’ light/dark mode
34
+
35
+
Related issue: [#75](https://github.com/readium/readium-css/issues/75)
36
+
37
+
The idea was to switch day/night theme based on the mode the user set in the Operating System’s preferences – using the `prefers-color-scheme` media query.
38
+
39
+
Once again, implementing this feature in ReadiumCSS would have made it unpredictable for app developers. Without any control over the application of themes, it would have been impossible to sync both the app UI and EPUB theme – resulting in a visible flash of unsynced content –, made it more difficult to handle the theme the user has set, etc.
Copy file name to clipboardExpand all lines: docs/ReadiumCSS_docs/OEBPS/Text/Section-019.xhtml
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@
15
15
16
16
<p>[Implementers’ doc]</p>
17
17
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>
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
19
20
20
<p>As a reminder, the priority is, in general:</p>
21
21
@@ -42,7 +42,7 @@
42
42
<sectionid="customizable-medias" class="level2">
43
43
<h2id="sigil_toc_id_183">Customizable medias</h2>
44
44
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>
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
46
47
47
<hr/>
48
48
@@ -76,13 +76,13 @@
76
76
<sectionid="customizable-flags" class="level2">
77
77
<h2id="sigil_toc_id_184">Customizable flags</h2>
78
78
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>
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
80
81
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 <ahref="../Text/Section-012.xhtml#sigil_toc_id_177">“User Settings”</a> and <ahref="../Text/Section-002.xhtml">“Quickstart”</a> docs for further details.</p>
82
82
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>
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>
<h1>Features that were considered but not implemented</h1>
15
+
16
+
<p>[Implementers’ doc] [WIP]</p>
17
+
18
+
<p>This document aims to list features that were considered but not implemented in ReadiumCSS, and clarify the reasons why they weren’t.</p>
19
+
20
+
<p>It is important to highlight that in most cases, features were not implemented because ReadiumCSS wasn’t the best way to handle them, not because they didn’t have strong use cases. If they were considered for implementation in the first place it is because they were useful, but ReadiumCSS couldn’t really implement them properly, or would have created issues for app developers, etc.</p>
21
+
22
+
<p>In other words, this document may also serve as a list of features you could choose to contribute in the various <ahref="https://github.com/readium">Readium SDKs and test apps</a> if they aren’t already implemented.</p>
<p>The idea was to add an alternate <code>background-color</code> to each line. Since CSS doesn’t have any concept of <code>nth-line</code>, you have to cheat and use a <code>linear-gradient</code> switching colors based on the current <code>line-height</code>.</p>
30
+
31
+
<p>Unfortunately, this doesn’t work well with fragmentation, and the linear gradient quickly becomes offset.</p>
32
+
33
+
<figure>
34
+
<imgsrc="../Images/alt-lines.png" alt="In the paginated view, it’s nearly impossible to get alternate lines right."/>
35
+
</figure>
36
+
37
+
<p>In addition, CSS is too limited to handle more complex cases such as images and, more generally, more complex structures. So you need JS for a good enough implementation.</p>
<p>The idea was to handle the text color (using the <code>calc()</code> function) when the user picks a background color in custom themes. For instance, text would have been automatically inverted (white instead of black) with a dark background. Obviously, that wouldn’t have prevented the user from picking another text color.</p>
46
+
47
+
<p>However, implementing this feature in ReadiumCSS would have made it unpredictable for app developers. Indeed, it would have made it difficult for them to synchronize the User Interface, and label the correct text color as active.</p>
48
+
49
+
<p>This feature should therefore be implemented in the app, as part of the custom themes component.</p>
<p>The idea was to switch day/night theme based on the mode the user set in the Operating System’s preferences – using the <code>prefers-color-scheme</code> media query.</p>
58
+
59
+
<p>Once again, implementing this feature in ReadiumCSS would have made it unpredictable for app developers. Without any control over the application of themes, it would have been impossible to sync both the app UI and EPUB theme – resulting in a visible flash of unsynced content –, made it more difficult to handle the theme the user has set, etc.</p>
0 commit comments