Skip to content

Commit 223e932

Browse files
committed
Update docs
Remove all instances of sepia, night, and reading modes
1 parent 50d0165 commit 223e932

52 files changed

Lines changed: 318 additions & 509 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

_includes/toc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<li><a href="CSS10-libre_fonts.html">Open Source and Libre Fonts We Can Recommend</a></li>
1313
<li><a href="CSS10b-variable_fonts.html">Variable fonts</a></li>
1414
<li><a href="CSS11-overrides_classification.html">User Overrides’ Classification</a></li>
15-
<li><a href="CSS12-user_prefs.html">User Settings, Reading Modes and Themes</a></li>
15+
<li><a href="CSS12-user_prefs.html">User Settings and Themes</a></li>
1616
<li><a href="CSS13-a11y_settings_baseline.html">Baseline for a11y-related user settings</a></li>
1717
<li><a href="CSS14-user_settings_recs.html">Recommendations for User Settings Management</a></li>
1818
<li><a href="CSS15-user_pref_insights.html">User Preferences’ insights</a></li>

css/ReadMe.md

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ Readium CSS is a set of reference stylesheets for EPUB Reading Systems. It provi
55
- a CSS normalize for EPUB contents;
66
- paged and scrolled views;
77
- default styles;
8-
- reading modes (night, sepia, etc.);
9-
- themes;
8+
- theming;
109
- user settings.
1110

1211
**Note:** Readium CSS stylesheets were not designed and should not be used for fixed-layout EPUB, nor other file formats like FB2, PRC, Mobi, TEI, etc.
@@ -48,23 +47,17 @@ In order to provide this customization, we use custom selectors, which will hope
4847

4948
### Flags for user settings
5049

51-
By default, we are using flags in the form of CSS variables to manage reading modes and user settings. But you might want to customize those flags in order to use custom attributes (`data-*`) or good old CSS classes.
50+
By default, we are using flags in the form of CSS variables to manage user settings. But you might want to customize those flags in order to use custom attributes (`data-*`) or good old CSS classes.
5251

5352
A complete list of flags can be found in the [User preferences doc](../docs/CSS12-user_prefs.md).
5453

55-
As an example, if you want to use a CSS class for night mode, it could look like:
56-
57-
```
58-
@custom-selector :--night-mode .night-mode;
59-
```
60-
61-
And if you want to use custom attributes for advanced settings, it could look like:
54+
As an example, if you want to use custom attributes for advanced settings, it could look like:
6255

6356
```
6457
@custom-selector :--advanced-settings [data-settings="advanced"];
6558
```
6659

67-
Both would then have to be appended to `html` at runtime.
60+
It would then have to be appended to `html` at runtime.
6861

6962
Once again, you must rebuild `dist` stylesheets.
7063

@@ -175,14 +168,6 @@ root.style.setProperty("--USER__bodyHyphens", "auto");
175168

176169
Of course this example is simplistic. You could for instance create an helper to set multiple properties at once.
177170

178-
#### Apply sepia mode
179-
180-
To apply the sepia mode, you can use a flag that will apply preset values.
181-
182-
```
183-
root.style.setProperty("--USER__appearance", "readium-sepia-on");
184-
```
185-
186171
## Create Themes
187172

188173
In Readium CSS model, themes are a set of user settings you can store and retrieve. Add the properties to `html` and you get a theme.
@@ -191,10 +176,11 @@ Depending on the prefix you are using, `--RS__` or `--USER__`, your theme will o
191176

192177
Check the [User Preferences doc](../docs/CSS12-user_prefs.md) for a list of available user variables.
193178

194-
You can also retrieve ReadiumCSS presets for font-stacks and modes by adding it as a package, then importing its exposed json files. For instance in JS/TS:
179+
You can also retrieve ReadiumCSS presets for font-stacks, colors and pagination by adding it as a package, then importing its exposed json files. For instance in JS/TS:
195180

196181
```
197-
import sepiaMode from "readium-css/css/vars/sepia.json";
182+
import defaultColors from "readium-css/css/vars/colors.json";
198183
199-
const sepiaBackground = sepiaMode.sepiaMode.RS__backgroundColor;
184+
const backgroundColor = defaultColors.RS__backgroundColor;
185+
const textColor = defaultColors.RS__color;
200186
```

css/ReadiumCSS-config.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
/* Readium CSS
22
Config module
33
4-
A file allowing implementers to customize flags for reading modes,
5-
user settings, etc.
4+
A file allowing implementers to customize flags for user settings, etc.
65
76
Repo: https://github.com/readium/css */
87

css/demo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
-moz-user-select: none;
3030
-ms-user-select: none;
3131
user-select: none;
32-
/* May help later with Reading modes so that bg can be applied to whole page
32+
/* May help later with theming so that bg can be applied to whole page
3333
You need to allowtransparency on the iframe though (and sanitize authors’ CSS) */
3434
background-color: transparent;
3535
}

css/demo/page.xhtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<p>Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation. Whenever I find myself growing grim about the mouth; whenever it is a damp, drizzly November in my soul; whenever I find myself involuntarily pausing before coffin warehouses, and bringing up the rear of every funeral I meet; and especially whenever my hypos get such an upper hand of me, that it requires a strong moral principle to prevent me from deliberately stepping into the street, and methodically knocking people’s hats off—then, I account it high time to get to sea as soon as I can. This is my substitute for pistol and ball. With a philosophical flourish Cato throws himself upon his sword; I quietly take to the ship. There is nothing surprising in this. If they but knew it, almost all men in their degree, some time or other, cherish very nearly the same feelings towards the ocean with me.</p>
4242

4343
<figure>
44-
<img alt="test if mix blend mode works in sepia, and invert in night mode" class="gaiji" src="assets/white.jpg" />
44+
<img alt="test if gaiji work" class="gaiji" src="assets/white.jpg" />
4545
</figure>
4646

4747
<p>There now is your insular city of the Manhattoes, belted round by wharves as Indian isles by coral reefs—commerce surrounds it with her surf. Right and left, the streets take you waterward. Its extreme downtown is the battery, where that noble mole is washed by waves, and cooled by breezes, which a few hours previous were out of sight of land. Look at the crowds of water-gazers there.</p>

docs/CSS01-readiumcss_fundamentals.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Indeed, EPUB is not supported natively so we must build on top of web browsers
1212

1313
With such a role comes great responsibility: we must try to behave like browsers are behaving – i.e. be liberal in what we accept from authors –, and find a sensible balance between authors’ stylesheets and users’ overrides.
1414

15-
Authors and users have expectations though, and we had to take those into account. For instance, they are used to having EPUB contents laid out in a paged view, with reading modes (paper, sepia, night) and a minimal set of common settings.
15+
Authors and users have expectations though, and we had to take those into account. For instance, they are used to having EPUB contents laid out in a paged view and a minimal set of common settings.
1616

1717
By serving as a User Agent, we must make sure:
1818

@@ -36,7 +36,7 @@ CSS has a lot to offer nowadays, and it can help solve complex issues in simpler
3636
Readium CSS has been be designed following 4 core principles:
3737

3838
1. **Modularity:** Readium CSS is not a monolithic stylesheet but a set of modules;
39-
2. **Separation of Reading System’s Concerns:** those modules are task-oriented e.g. paginate, apply default styles, intercept styles for reading modes or user settings, apply a reading mode or user setting, apply a theme, etc.;
39+
2. **Separation of Reading System’s Concerns:** those modules are task-oriented e.g. paginate, apply default styles, intercept styles for user settings, apply a user setting or theme, etc.;
4040
3. **Daisy-chainability:** those modules can be loaded and daisy-chained (cascade) depending on conditions;
4141
4. **Customization:** modules can be customized either before or during runtime (CSS variables), which implies themes can be generated within minutes.
4242

docs/CSS02-quickstart.md

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ Readium CSS is a set of reference stylesheets for EPUB Reading Systems. It provi
77
- a CSS normalize for EPUB contents;
88
- paged and scrolled views;
99
- default styles;
10-
- reading modes (night, sepia, etc.);
11-
- themes;
10+
- theming;
1211
- user settings.
1312

1413
**Note:** Readium CSS stylesheets were not designed and should not be used for fixed-layout EPUB, nor other file formats like FB2, PRC, Mobi, TEI, etc.
@@ -50,14 +49,14 @@ In order to provide this customization, we use custom selectors, which will hope
5049

5150
### Flags for user settings
5251

53-
By default, we are using flags in the form of CSS variables to manage reading modes and user settings. But you might want to customize those flags in order to use custom attributes (`data-*`) or good old CSS classes.
52+
By default, we are using flags in the form of CSS variables to manage user settings. But you might want to customize those flags in order to use custom attributes (`data-*`) or good old CSS classes.
5453

5554
A complete list of flags can be found in the [User preferences doc](../docs/CSS12-user_prefs.md).
5655

57-
As an example, if you want to use a CSS class for night mode, it could look like:
56+
As an example, if you want to use custom attributes for advanced settings, it could look like:
5857

5958
```
60-
@custom-selector :--night-mode .night-mode;
59+
@custom-selector :--advanced-settings [data-settings="advanced"];
6160
```
6261

6362
It would then have to be appended to `html` at runtime.
@@ -170,15 +169,6 @@ root.style.setProperty("--USER__bodyHyphens", "auto");
170169

171170
Of course this example is simplistic. You could for instance create an helper to set multiple properties at once.
172171

173-
#### Apply sepia mode
174-
175-
To apply the sepia mode, you can use a flag that will apply preset values.
176-
177-
```
178-
root.style.setProperty("--USER__appearance", "readium-sepia-on");
179-
180-
```
181-
182172
## Create Themes
183173

184174
In Readium CSS model, themes are a set of user settings you can store and retrieve. Add the properties to `html` and you get a theme.
@@ -187,10 +177,11 @@ Depending on the prefix you are using, `--RS__` or `--USER__`, your theme will o
187177

188178
Check the [User Preferences doc](../docs/CSS12-user_prefs.md) for a list of available user variables.
189179

190-
You can also retrieve ReadiumCSS presets for font-stacks and modes by adding it as a dependency, then importing its exposed json files. For instance in JS/TS:
180+
You can also retrieve ReadiumCSS presets for font-stacks, colors and pagination by adding it as a dependency, then importing its exposed json files. For instance in JS/TS:
191181

192182
```
193-
import sepiaMode from "readium-css/css/vars/sepia.json";
183+
import defaultColors from "readium-css/css/vars/colors.json";
194184
195-
const sepiaBackground = sepiaMode.sepiaMode.RS__backgroundColor;
185+
const backgroundColor = defaultColors.RS__backgroundColor;
186+
const textColor = defaultColors.RS__color;
196187
```

docs/CSS03-injection_and_pagination.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Finally, on larger screens, you’ll have to set dimensions on this container so
2222

2323
### Background color
2424

25-
Please note you must deal with the `background-color` outside this container, especially as the user can set reading modes (night, sepia, etc.). In other words, it must be synced with this user setting so that the entire screen is the same `background-color`.
25+
Please note you must deal with the `background-color` outside this container, especially as the user could set an arbitrary color through theming. In other words, it must be synced with this user setting so that the entire screen is the same `background-color`.
2626

2727
As a friendly reminder, you can allow transparency for the iframe if you’re using one. That should help deal with `background-color` at the global level.
2828

docs/CSS04-multicolumn_layout.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,7 @@ What is important to remark is that:
217217

218218
## Reflow
219219

220-
CSS multicol relies on a complex (fragmentation) logic, and this logic varies for each browser.
221-
222-
In Blink and Webkit for instance, a reflow won’t happen for the document (`:root`) if we don’t force a reflow at the `body` level. As a consequence, we’re using the `--RS__defaultLineLength` CSS variable to force this reflow and slightly alter its value whenever needed e.g. “pagination to scroll” in vertical writing, `mix-blend-mode` in sepia mode, “number of columns” user setting, etc.
223-
224-
This will recalc the `body`’s `max-width`, causing a reflow which will propagate to the column layout we set for `:root`.
220+
CSS multicol relies on a complex (fragmentation) logic, and this logic varies for each browser. In some cases, it can be necessary to force a reflow or recalc to update the layout.
225221

226222
## Notorious limitations
227223

docs/CSS08-defaults.md

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
[Implementers’ doc] [Authors’ info]
44

5-
Defaults is currently made of 5 stylesheets:
5+
Defaults is currently made of 2 stylesheets:
66

77
- 1 base stylesheet for all ebooks;
8-
- 1 default reading mode stylesheet for all ebooks;
9-
- 1 default stylesheet for unstyled ebooks;
10-
- 1 stylesheet to deal with the OS’ a11y modes.
8+
- 1 default stylesheet for unstyled ebooks.
119

1210
**Note:** The default stylesheet should not be appended if there are author styles in the EPUB file.
1311

@@ -341,15 +339,4 @@ An optional primary accentuation `color` you could use for headings or any other
341339
--RS__secondaryColor
342340
```
343341

344-
An optional secondary accentuation `color` you could use for any element of your choice.
345-
346-
## OS’ a11y modes
347-
348-
This stylesheet is intended to deal with a11y settings users can set at the OS level, whenever possible:
349-
350-
- high-contrast mode;
351-
- inverted colors;
352-
- monochrome;
353-
- reduced motion.
354-
355-
For `monochrome`, we’ll have to adjust reading modes (night, sepia, etc.) in their specific stylesheet; we’ll see if we can at least manage some more global settings in there.
342+
An optional secondary accentuation `color` you could use for any element of your choice.

0 commit comments

Comments
 (0)