Skip to content

Commit 246dc45

Browse files
committed
Add docs listing considered features
1 parent 784142c commit 246dc45

10 files changed

Lines changed: 1361 additions & 1217 deletions

File tree

_includes/toc.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@
2626
<li><a href="CSS24-eprdctn_requests.html">E-production feedback and requests</a></li>
2727
<li><a href="CSS25-performance_hacks.html">CSS Performance Hacks</a></li>
2828
<li><a href="CSS26-i18n_glossary.html">i18n glossary</a></li>
29+
<li><a href="CSS27-considered_features.html">Features that were considered but not implemented</a></li>
2930
</ol>
3031
</nav>

docs/CSS27-considered_features.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# 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+
![In the paginated view, it’s nearly impossible to get alternate lines right.](assets/alt-lines.png)
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.

docs/ReadiumCSS_docs.epub

285 KB
Binary file not shown.
288 KB
Loading

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
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>
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>
1919

2020
<p>As a reminder, the priority is, in general:</p>
2121

@@ -42,7 +42,7 @@
4242
<section id="customizable-medias" class="level2">
4343
<h2 id="sigil_toc_id_183">Customizable medias</h2>
4444

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>
4646

4747
<hr/>
4848

@@ -76,13 +76,13 @@
7676
<section id="customizable-flags" class="level2">
7777
<h2 id="sigil_toc_id_184">Customizable flags</h2>
7878

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>
8080

8181
<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>
8282

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>
8484

85-
<hr/>
85+
<hr/>
8686

8787
<pre><code>:--paged-view</code></pre>
8888

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!DOCTYPE html>
3+
4+
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xml:lang="en">
5+
<head>
6+
<meta charset="utf-8"/>
7+
<meta name="generator" content="pandoc"/>
8+
<title>Readium CSS Implementers’ doc</title>
9+
<link rel="stylesheet" type="text/css" href="../Styles/stylesheet.css"/>
10+
</head>
11+
12+
<body xml:lang="en">
13+
<section id="features-that-were-considered-but-not-implemented" class="level1">
14+
<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 <a href="https://github.com/readium">Readium SDKs and test apps</a> if they aren’t already implemented.</p>
23+
24+
<section id="alternate-background-colors-for-lines-a11y" class="level2">
25+
<h2 id="sigil_toc_id_188">Alternate background colors for lines (A11Y)</h2>
26+
27+
<p>Related issue: <a href="https://github.com/readium/readium-css/issues/39">#39</a></p>
28+
29+
<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+
<img src="../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>
38+
</section>
39+
40+
<section id="contrasting-text-against-backgrounds-in-custom-user-themes" class="level2">
41+
<h2 id="sigil_toc_id_189">Contrasting text against backgrounds in custom user themes</h2>
42+
43+
<p>Related issue: <a href="https://github.com/readium/readium-css/issues/74">#74</a></p>
44+
45+
<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>
50+
</section>
51+
52+
<section id="handle-daynight-theme-based-on-oss-lightdark-mode" class="level2">
53+
<h2 id="sigil_toc_id_190">Handle day/night theme based on OSs’ light/dark mode</h2>
54+
55+
<p>Related issue: <a href="https://github.com/readium/readium-css/issues/75">#75</a></p>
56+
57+
<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>
60+
</section>
61+
</section>
62+
</body>
63+
</html>

docs/ReadiumCSS_docs/OEBPS/Text/nav.xhtml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,20 @@
665665
</li>
666666
</ol>
667667
</li>
668+
<li>
669+
<a href="../Text/Section-027.xhtml">Features that were considered but not implemented</a>
670+
<ol>
671+
<li>
672+
<a href="../Text/Section-027.xhtml#sigil_toc_id_188">Alternate background colors for lines (A11Y)</a>
673+
</li>
674+
<li>
675+
<a href="../Text/Section-027.xhtml#sigil_toc_id_189">Contrasting text against backgrounds in custom user themes</a>
676+
</li>
677+
<li>
678+
<a href="../Text/Section-027.xhtml#sigil_toc_id_190">Handle day/night theme based on OSs’ light/dark mode</a>
679+
</li>
680+
</ol>
681+
</li>
668682
</ol>
669683
</nav>
670684
<nav epub:type="landmarks" hidden="hidden">

docs/ReadiumCSS_docs/OEBPS/content.opf

Lines changed: 4 additions & 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">2020-03-10T20:56:35Z</meta>
11+
<meta property="dcterms:modified">2020-04-30T19:10:46Z</meta>
1212
<meta content="0.9.5" name="Sigil version"/>
1313
<meta property="schema:accessibilityFeature">displayTransformability</meta>
1414
<meta property="schema:accessibilityFeature">readingOrder</meta>
@@ -74,6 +74,8 @@
7474
<item href="Text/Section-015.xhtml" id="Section-015.xhtml" media-type="application/xhtml+xml"/>
7575
<item href="Text/Section-025.xhtml" id="Section-025.xhtml" media-type="application/xhtml+xml"/>
7676
<item href="Text/Section-016.xhtml" id="Section-016.xhtml" media-type="application/xhtml+xml"/>
77+
<item href="Text/Section-027.xhtml" id="Section-027.xhtml" media-type="application/xhtml+xml"/>
78+
<item href="Images/alt-lines.png" id="alt-lines.png" media-type="image/png"/>
7779
</manifest>
7880
<spine toc="ncx">
7981
<itemref idref="cover_xhtml"/>
@@ -104,6 +106,7 @@
104106
<itemref idref="Section-024.xhtml"/>
105107
<itemref idref="Section-025.xhtml"/>
106108
<itemref idref="Section-026.xhtml"/>
109+
<itemref idref="Section-027.xhtml"/>
107110
</spine>
108111
<guide>
109112
<reference href="Text/cover.xhtml" title="Cover" type="cover"/>

0 commit comments

Comments
 (0)