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: docs/CSS12-user_prefs.md
+33-9Lines changed: 33 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,16 +37,30 @@ You don’t need to remove the variable before setting another value, the new va
37
37
38
38
#### Removing
39
39
40
+
You can either remove the style explicitly with `removeProperty()`:
41
+
40
42
```
41
43
var root = document.documentElement;
42
44
43
45
root.style.removeProperty("name of var");
44
46
```
45
47
48
+
Or implicitly by using an empty string as a value with `setProperty()`:
49
+
50
+
```
51
+
var root = document.documentElement;
52
+
53
+
root.style.setProperty("name of var", "");
54
+
```
55
+
56
+
Setting a property with an empty string as the value will indeed invoke `removeProperty()`, as defined in the [CSS Object Model Spec](https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty).
57
+
46
58
## Flags
47
59
48
60
Some variables behave like flags. You could also use custom `data-*` attributes or CSS classes to manage the following ones. See the [“Quickstart” doc](../docs/CSS02-quickstart.md) for customization.
49
61
62
+
By default, those flags are not set. Then their initialization depends on your user settings’ management e.g. apply user settings to all EPUBs, only the ones that have already been customized, etc.
63
+
50
64
### User view
51
65
52
66
Allows to switch between paged and scroll view.
@@ -55,10 +69,12 @@ Allows to switch between paged and scroll view.
55
69
--USER__view
56
70
```
57
71
58
-
Possible values: `readium-paged-on` | `readium-scroll-on`
Override class: Chrome (should be applied by any means necessary)
61
75
76
+
If the flag is not set, ReadiumCSS will fall back to the paged view.
77
+
62
78
### Font Family override
63
79
64
80
Acts as an explicit switch to override the publisher’s `font-family`.
@@ -67,11 +83,11 @@ Acts as an explicit switch to override the publisher’s `font-family`.
67
83
--USER__fontOverride
68
84
```
69
85
70
-
Possible values: `readium-font-on` | `readium-font-off`
86
+
Supported value: `readium-font-on`
71
87
72
88
Override class: None. This flag is required to change the `font-family` user setting.
73
89
74
-
To switch back to the publisher’s font, you can either change the value to `readium-font-off`or remove the flag.
90
+
To switch back to the publisher’s font, you can either set an empty string as a value or remove the property.
75
91
76
92
### Advanced Settings
77
93
@@ -83,11 +99,11 @@ If you provide users with a “Publisher’s styles” toggle, it must be enable
83
99
--USER__advancedSettings
84
100
```
85
101
86
-
Possible values: `readium-advanced-on` | `readium-advanced-off`
102
+
Supported value: `readium-advanced-on`
87
103
88
104
Override class: None. This flag is required to apply the `font-family`, the `font-size` and/or advanced user settings.
89
105
90
-
To switch back to the publisher’s styles, you can either change the value to `readium-advanced-off`or remove it. This will disable all advanced settings requiring the flag.
106
+
To switch back to the publisher’s styles, you can either set an empty string as a value or remove the property. This will disable all advanced settings requiring the flag.
91
107
92
108
### Reading Modes
93
109
@@ -97,10 +113,12 @@ We currently have two reading modes for night and sepia.
97
113
--USER__appearance
98
114
```
99
115
100
-
Possible values: `readium-day-on` | `readium-sepia-on` | `readium-night-on`
Copy file name to clipboardExpand all lines: docs/CSS19-api.md
+28-26Lines changed: 28 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
[Implementers’ doc]
4
4
5
+
This document is meant to list all the customizable medias and flags (to be found in `ReadiumCSS-config.css`), as well as all the CSS variables for Reading System and User styles available in the `dist` stylesheets.
You will find those customizable medias in `ReadiumCSS-config.css`. The values defined are used in media queries to control use of the auto pagination model.
36
+
33
37
* * *
34
38
35
39
```
@@ -66,21 +70,33 @@ The maximum device width of the mobile device for which the auto pagination mode
66
70
67
71
## Customizable flags
68
72
69
-
Those custom selectors can be customized before runtime. Check the [“Quickstart” doc](../docs/CSS02-quickstart.md) for further details.
73
+
You will find those customizable flags in `ReadiumCSS-config.css`, and can think of the preset values as boolean inline styles: if they are set on the `:root` element (i.e. `html`) then the flag is enabled. If another value is, or they are removed, then the flag is disabled.
74
+
75
+
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 [“User Preferences”](../docs/CSS12-user_prefs.md#flags) and [“Quickstart”](../docs/CSS02-quickstart.md) docs for further details.
70
76
71
-
The “dummy CSS variable” is a recommended CSS custom property name you can use to set the default value if you don’t customize those selectors and just keep the default.
77
+
**Note:**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.
72
78
73
79
* * *
74
80
75
81
```
76
-
:--scroll-view
82
+
:--paged-view
77
83
```
78
84
79
-
Default is `readium-scroll-on`
85
+
Preset: `--USER__view: readium-paged-on`
80
86
81
87
Scope: `html`
82
88
83
-
Dummy CSS variable: `--USER__view`
89
+
Override class: Chrome (should be applied by any means necessary)
90
+
91
+
* * *
92
+
93
+
```
94
+
:--scroll-view
95
+
```
96
+
97
+
Preset: `--USER__view: readium-scroll-on`
98
+
99
+
Scope: `html`
84
100
85
101
Override class: Chrome (should be applied by any means necessary)
86
102
@@ -90,12 +106,10 @@ Override class: Chrome (should be applied by any means necessary)
90
106
:--font-override
91
107
```
92
108
93
-
Default is `readium-font-on`
109
+
Preset: `--USER__fontOverride: readium-font-on`
94
110
95
111
Scope: `html`
96
112
97
-
Dummy CSS variable: `--USER__fontOverride`
98
-
99
113
Override class: None. This flag is required to change the `font-family` user setting.
100
114
101
115
* * *
@@ -104,12 +118,10 @@ Override class: None. This flag is required to change the `font-family` user set
0 commit comments