Skip to content

Commit e261c0b

Browse files
authored
Merge pull request #194 from readium/modes-removal
Modes removal
2 parents 563243e + 6ca384e commit e261c0b

File tree

82 files changed

+336
-1519
lines changed

Some content is hidden

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

82 files changed

+336
-1519
lines changed

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

backstop.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,6 @@
9292
"selectors": ["document"],
9393
"misMatchThreshold" : 0.1
9494
},
95-
{
96-
"label": "Sepia mode pref",
97-
"url": "http://localhost:8000/tests/sepia.html",
98-
"delay": 0,
99-
"selectors": ["document"],
100-
"misMatchThreshold" : 0.1
101-
},
102-
{
103-
"label": "Night mode pref",
104-
"url": "http://localhost:8000/tests/night.html",
105-
"delay": 0,
106-
"selectors": ["document"],
107-
"misMatchThreshold" : 0.1
108-
},
10995
{
11096
"label": "Theming (Reading System)",
11197
"url": "http://localhost:8000/tests/theming.html",

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 & 6 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

@@ -21,10 +20,6 @@
2120
/* Font-size normalization for engines that don’t support zoom */
2221
@custom-selector :--fs-normalize [style*="readium-normalize-on"];
2322

24-
/* Reading Modes */
25-
@custom-selector :--sepia-mode [style*="readium-sepia-on"];
26-
@custom-selector :--night-mode [style*="readium-night-on"];
27-
2823
/* Filters (images) */
2924
@custom-selector :--blend-filter [style*="readium-blend-on"];
3025
@custom-selector :--darken-filter [style*="readium-darken-on"];

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>

css/dist/ReadiumCSS-after.css

Lines changed: 1 addition & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Readium CSS v.2.0.0-beta.18
2+
* Readium CSS v.2.0.0-beta.19
33
* Copyright (c) 2017–2025. Readium Foundation. All rights reserved.
44
* Use of this source code is governed by a BSD-style license which is detailed in the
55
* LICENSE file present in the project repository where this source code is maintained.
@@ -140,145 +140,6 @@ body{
140140
padding-right:var(--RS__scrollPaddingRight) !important;
141141
}
142142

143-
:root[style*="readium-night-on"]{
144-
145-
--RS__selectionTextColor:inherit;
146-
147-
--RS__selectionBackgroundColor:#b4d8fe;
148-
149-
--RS__visitedColor:#0099E5;
150-
151-
--RS__linkColor:#63caff;
152-
153-
--RS__textColor:#FEFEFE;
154-
155-
--RS__backgroundColor:#000000;
156-
}
157-
158-
:root[style*="readium-night-on"] *:not(a){
159-
color:inherit !important;
160-
background-color:transparent !important;
161-
border-color:currentcolor !important;
162-
}
163-
164-
:root[style*="readium-night-on"] svg text{
165-
fill:currentcolor !important;
166-
stroke:none !important;
167-
}
168-
169-
:root[style*="readium-night-on"] a:link,
170-
:root[style*="readium-night-on"] a:link *{
171-
color:var(--RS__linkColor) !important;
172-
}
173-
174-
:root[style*="readium-night-on"] a:visited,
175-
:root[style*="readium-night-on"] a:visited *{
176-
color:var(--RS__visitedColor) !important;
177-
}
178-
179-
:root[style*="readium-night-on"] img[class*="gaiji"],
180-
:root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child,
181-
:root[style*="readium-night-on"] *[epub|type~="titlepage"] img:only-child{
182-
-webkit-filter:invert(100%);
183-
filter:invert(100%);
184-
}
185-
186-
:root[style*="readium-sepia-on"]{
187-
188-
--RS__selectionTextColor:inherit;
189-
190-
--RS__selectionBackgroundColor:#b4d8fe;
191-
192-
--RS__visitedColor:#551A8B;
193-
194-
--RS__linkColor:#0000EE;
195-
196-
--RS__textColor:#121212;
197-
198-
--RS__backgroundColor:#faf4e8;
199-
}
200-
201-
:root[style*="readium-sepia-on"] *:not(a){
202-
color:inherit !important;
203-
background-color:transparent !important;
204-
}
205-
206-
:root[style*="readium-sepia-on"] a:link,
207-
:root[style*="readium-sepia-on"] a:link *{
208-
color:var(--RS__linkColor);
209-
}
210-
211-
:root[style*="readium-sepia-on"] a:visited,
212-
:root[style*="readium-sepia-on"] a:visited *{
213-
color:var(--RS__visitedColor);
214-
}
215-
216-
@media screen and (-ms-high-contrast: active){
217-
218-
:root{
219-
color:windowText !important;
220-
background-color:window !important;
221-
}
222-
223-
:root :not(#\#):not(#\#):not(#\#),
224-
:root :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#)
225-
:root :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#){
226-
color:inherit !important;
227-
background-color:inherit !important;
228-
}
229-
230-
.readiumCSS-mo-active-default{
231-
color:highlightText !important;
232-
background-color:highlight !important;
233-
}
234-
}
235-
236-
@media screen and (-ms-high-contrast: white-on-black){
237-
238-
:root[style*="readium-night-on"] img[class*="gaiji"],
239-
:root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child,
240-
:root[style*="readium-night-on"] *[epub|type~="titlepage"] img:only-child{
241-
-webkit-filter:none !important;
242-
filter:none !important;
243-
}
244-
245-
:root[style*="readium-night-on"][style*="readium-invert-on"] img{
246-
-webkit-filter:none !important;
247-
filter:none !important;
248-
}
249-
250-
:root[style*="readium-night-on"][style*="readium-darken-on"][style*="readium-invert-on"] img{
251-
-webkit-filter:brightness(80%);
252-
filter:brightness(80%);
253-
}
254-
}
255-
256-
@media screen and (inverted-colors){
257-
258-
:root[style*="readium-night-on"] img[class*="gaiji"],
259-
:root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child,
260-
:root[style*="readium-night-on"] *[epub|type~="titlepage"] img:only-child{
261-
-webkit-filter:none !important;
262-
filter:none !important;
263-
}
264-
265-
:root[style*="readium-night-on"][style*="readium-invert-on"] img{
266-
-webkit-filter:none !important;
267-
filter:none !important;
268-
}
269-
270-
:root[style*="readium-night-on"][style*="readium-darken-on"][style*="readium-invert-on"] img{
271-
-webkit-filter:brightness(80%);
272-
filter:brightness(80%);
273-
}
274-
}
275-
276-
@media screen and (monochrome){
277-
}
278-
279-
@media screen and (prefers-reduced-motion){
280-
}
281-
282143
:root[style*="--USER__backgroundColor"]{
283144
background-color:var(--USER__backgroundColor) !important;
284145
}

css/dist/ReadiumCSS-before.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Readium CSS v.2.0.0-beta.18
2+
* Readium CSS v.2.0.0-beta.19
33
* Copyright (c) 2017–2025. Readium Foundation. All rights reserved.
44
* Use of this source code is governed by a BSD-style license which is detailed in the
55
* LICENSE file present in the project repository where this source code is maintained.

css/dist/ReadiumCSS-default.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Readium CSS v.2.0.0-beta.18
2+
* Readium CSS v.2.0.0-beta.19
33
* Copyright (c) 2017–2025. Readium Foundation. All rights reserved.
44
* Use of this source code is governed by a BSD-style license which is detailed in the
55
* LICENSE file present in the project repository where this source code is maintained.

0 commit comments

Comments
 (0)