Skip to content

Commit f8a35f3

Browse files
committed
Remove day mode
This is now part of base as default
1 parent aa89bfb commit f8a35f3

34 files changed

Lines changed: 349 additions & 363 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Readium CSS provides styles for reflowable text:
99
- paged and scrolled views;
1010
- a “patch” for HTML5 Suggested Rendering specific to publications (e.g. extra styles for hyphenation, breaks, etc.);
1111
- default styles for unstyled ebooks;
12-
- reading modes (day, night, and sepia);
12+
- reading modes (night and sepia);
1313
- themes;
1414
- user settings;
1515
- a set of baselines and recommendations for accessibility, overrides, and internationalization.

backstop.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272
"misMatchThreshold" : 0.1
7373
},
7474
{
75-
"label": "Day mode pref",
76-
"url": "http://localhost:8000/tests/day.html",
75+
"label": "Default colors pref",
76+
"url": "http://localhost:8000/tests/default-colors.html",
7777
"delay": 0,
7878
"selectors": ["document"],
7979
"misMatchThreshold" : 0.1

css/ReadMe.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ In the `css/src` folder, you’ll find all the needed stylesheets you will proce
7777
```
7878
@import "../ReadiumCSS-config.css";
7979
@import "modules/ReadiumCSS-base.css";
80-
@import "modules/ReadiumCSS-day_mode.css";
8180
@import "modules/ReadiumCSS-fonts.css";
8281
@import "modules/ReadiumCSS-html5patch.css";
8382
@import "modules/ReadiumCSS-safeguards.css";
@@ -176,17 +175,19 @@ root.style.setProperty("--USER__bodyHyphens", "auto");
176175

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

179-
#### Apply sepia theme/mode
178+
#### Apply sepia mode
180179

181-
To apply the sepia theme/mode, you can use a flag that will apply preset values.
180+
To apply the sepia mode, you can use a flag that will apply preset values.
182181

183182
```
184183
root.style.setProperty("--USER__appearance", "readium-sepia-on");
185184
```
186185

187186
## Create Themes
188187

189-
In this model, themes are a set of user settings you can store and retrieve. Add the properties to `html` and you get a theme.
188+
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.
189+
190+
Depending on the prefix you are using, `--RS__` or `--USER__`, your theme will override the publisher’s styles or not. The rule being `USER > PUBLISHER > RS`.
190191

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@import "../ReadiumCSS-config.css";
22
@import "modules/ReadiumCSS-namespaces.css";
33
@import "modules/ReadiumCSS-base.css";
4-
@import "modules/ReadiumCSS-day_mode.css";
54
/* @import "modules/ReadiumCSS-fonts.css"; */
65
@import "modules/ReadiumCSS-html5patch.css";
76
@import "modules/ReadiumCSS-safeguards.css";
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@import "../ReadiumCSS-config.css";
22
@import "modules/ReadiumCSS-namespaces.css";
33
@import "modules/ReadiumCSS-base.css";
4-
@import "modules/ReadiumCSS-day_mode.css";
54
/* @import "modules/ReadiumCSS-fonts.css"; */
65
@import "modules/ReadiumCSS-html5patch.css";
76
@import "modules/ReadiumCSS-safeguards-vertical.css";

css/src/ReadiumCSS-before-rtl.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@import "../ReadiumCSS-config.css";
22
@import "modules/ReadiumCSS-namespaces.css";
33
@import "modules/ReadiumCSS-base.css";
4-
@import "modules/ReadiumCSS-day_mode.css";
54
/* @import "modules/ReadiumCSS-fonts.css"; */
65
@import "modules/ReadiumCSS-html5patch.css";
76
@import "modules/ReadiumCSS-safeguards.css";

css/src/ReadiumCSS-before.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@import "../ReadiumCSS-config.css";
22
@import "modules/ReadiumCSS-namespaces.css";
33
@import "modules/ReadiumCSS-base.css";
4-
@import "modules/ReadiumCSS-day_mode.css";
54
@import "modules/ReadiumCSS-fonts.css";
65
@import "modules/ReadiumCSS-html5patch.css";
76
@import "modules/ReadiumCSS-safeguards.css";

css/src/modules/ReadiumCSS-base.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,25 @@
2626
--RS__lineHeightCompensation: 1;
2727

2828
--RS__baseLineHeight: calc(1.5 * var(--RS__lineHeightCompensation));
29+
30+
/* Default theme (previously implemented as day mode) */
31+
@import-json "../../vars/day.json";
32+
33+
background-color: var(--RS__backgroundColor) !important;
34+
color: var(--RS__textColor) !important;
35+
}
36+
37+
/* Note: We’re not defining colors of links cos’ the selector specificity with :link and :visited could override publishers’ styles */
38+
39+
/* Note: Though `::selection` was present in drafts of CSS Selectors Level 3, it was removed during the Candidate Recommendation phase because its behavior was under-specified (especially with nested elements) and interoperability wasn’t achieved. Source: https://developer.mozilla.org/en-US/docs/Web/CSS/::selection */
40+
::-moz-selection {
41+
background-color: var(--RS__selectionBackgroundColor);
42+
color: var(--RS__selectionTextColor);
43+
}
44+
45+
::selection {
46+
background-color: var(--RS__selectionBackgroundColor);
47+
color: var(--RS__selectionTextColor);
2948
}
3049

3150
/* Set default font for the html doc, so that it can be overridden by the authors’s stylesheet */

css/src/modules/ReadiumCSS-day_mode.css

Lines changed: 0 additions & 32 deletions
This file was deleted.

css/src/modules/ReadiumCSS-night_mode.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
@import-json "../../vars/night.json";
1414
}
1515

16-
/* we don’t need to redeclare bg-color and color for :root since we will inherit and update from day/default mode */
16+
/* we don’t need to redeclare bg-color and color for :root since we will inherit and update from base */
1717

1818
:root:--night-mode *:not(a) {
1919
background-color: transparent !important;

0 commit comments

Comments
 (0)