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
Copy file name to clipboardExpand all lines: css/ReadMe.md
+8-22Lines changed: 8 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,7 @@ Readium CSS is a set of reference stylesheets for EPUB Reading Systems. It provi
5
5
- a CSS normalize for EPUB contents;
6
6
- paged and scrolled views;
7
7
- default styles;
8
-
- reading modes (night, sepia, etc.);
9
-
- themes;
8
+
- theming;
10
9
- user settings.
11
10
12
11
**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
48
47
49
48
### Flags for user settings
50
49
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.
52
51
53
52
A complete list of flags can be found in the [User preferences doc](../docs/CSS12-user_prefs.md).
54
53
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:
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
191
176
192
177
Check the [User Preferences doc](../docs/CSS12-user_prefs.md) for a list of available user variables.
193
178
194
-
You can also retrieve ReadiumCSS presets for font-stacksand 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:
195
180
196
181
```
197
-
import sepiaMode from "readium-css/css/vars/sepia.json";
182
+
import defaultColors from "readium-css/css/vars/colors.json";
Copy file name to clipboardExpand all lines: css/demo/page.xhtml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@
41
41
<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>
42
42
43
43
<figure>
44
-
<imgalt="test if mix blend mode works in sepia, and invert in night mode" class="gaiji" src="assets/white.jpg" />
44
+
<imgalt="test if gaiji work" class="gaiji" src="assets/white.jpg" />
45
45
</figure>
46
46
47
47
<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>
Copy file name to clipboardExpand all lines: docs/CSS01-readiumcss_fundamentals.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Indeed, EPUB is not supported natively so we must build on top of web browsers
12
12
13
13
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.
14
14
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.
16
16
17
17
By serving as a User Agent, we must make sure:
18
18
@@ -36,7 +36,7 @@ CSS has a lot to offer nowadays, and it can help solve complex issues in simpler
36
36
Readium CSS has been be designed following 4 core principles:
37
37
38
38
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.;
40
40
3.**Daisy-chainability:** those modules can be loaded and daisy-chained (cascade) depending on conditions;
41
41
4.**Customization:** modules can be customized either before or during runtime (CSS variables), which implies themes can be generated within minutes.
Copy file name to clipboardExpand all lines: docs/CSS02-quickstart.md
+8-17Lines changed: 8 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,7 @@ Readium CSS is a set of reference stylesheets for EPUB Reading Systems. It provi
7
7
- a CSS normalize for EPUB contents;
8
8
- paged and scrolled views;
9
9
- default styles;
10
-
- reading modes (night, sepia, etc.);
11
-
- themes;
10
+
- theming;
12
11
- user settings.
13
12
14
13
**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
50
49
51
50
### Flags for user settings
52
51
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.
54
53
55
54
A complete list of flags can be found in the [User preferences doc](../docs/CSS12-user_prefs.md).
56
55
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:
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
187
177
188
178
Check the [User Preferences doc](../docs/CSS12-user_prefs.md) for a list of available user variables.
189
179
190
-
You can also retrieve ReadiumCSS presets for font-stacksand 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:
191
181
192
182
```
193
-
import sepiaMode from "readium-css/css/vars/sepia.json";
183
+
import defaultColors from "readium-css/css/vars/colors.json";
Copy file name to clipboardExpand all lines: docs/CSS03-injection_and_pagination.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ Finally, on larger screens, you’ll have to set dimensions on this container so
22
22
23
23
### Background color
24
24
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`.
26
26
27
27
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.
Copy file name to clipboardExpand all lines: docs/CSS04-multicolumn_layout.md
+1-5Lines changed: 1 addition & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -217,11 +217,7 @@ What is important to remark is that:
217
217
218
218
## Reflow
219
219
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.
Copy file name to clipboardExpand all lines: docs/CSS08-defaults.md
+3-16Lines changed: 3 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,10 @@
2
2
3
3
[Implementers’ doc][Authors’ info]
4
4
5
-
Defaults is currently made of 5 stylesheets:
5
+
Defaults is currently made of 2 stylesheets:
6
6
7
7
- 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.
11
9
12
10
**Note:** The default stylesheet should not be appended if there are author styles in the EPUB file.
13
11
@@ -341,15 +339,4 @@ An optional primary accentuation `color` you could use for headings or any other
341
339
--RS__secondaryColor
342
340
```
343
341
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