Skip to content

Commit 0ec96a6

Browse files
committed
Remove font-override
Closes #181
1 parent 95a3c8a commit 0ec96a6

24 files changed

Lines changed: 64 additions & 99 deletions

css/ReadiumCSS-config.css

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
@custom-selector :--paged-view [style*="readium-paged-on"];
1616
@custom-selector :--scroll-view [style*="readium-scroll-on"];
1717

18-
/* Font-family override */
19-
@custom-selector :--font-override [style*="readium-font-on"];
20-
2118
/* Disabling the new implementation for font-size */
2219
@custom-selector :--deprecated-font-size [style*="readium-deprecatedFontSize-on"];
2320

css/demo/demo-script.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ document.addEventListener("DOMContentLoaded", function() {
88
label.textContent = "Add ReadiumCSS flags and prefs: ";
99
input.type = "text";
1010
input.name = "rcss";
11-
input.value = "--RS__advancedSettings: readium-advanced-on; --USER__fontOverride: readium-font-on;"
1211
label.appendChild(input);
1312
document.documentElement.appendChild(label);
1413

css/src/modules/user-settings-submodules/ReadiumCSS-a11yFont_pref.css

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,50 @@
22
A11y font pref
33
44
A submodule managing a11y text normalization for user settings
5-
Part of “User Overrides” class – “font override” flag required.
5+
Part of “User Overrides” class – no flag required.
66
77
Repo: https://github.com/readium/css */
88

99
/* For AccessibleDfA, we need to normalize font-weight and font-style since only the normal style is available */
1010

11-
:root:--font-override[style*="AccessibleDfA"] {
11+
:root[style*="AccessibleDfA"] {
1212
/* We won’t use the variable there since we need fallbacks for missing characters */
1313
font-family: AccessibleDfA, Verdana, Tahoma, "Trebuchet MS", sans-serif !important;
1414
}
1515

16-
:root:--font-override[style*="IA Writer Duospace"] {
16+
:root[style*="IA Writer Duospace"] {
1717
/* We won’t use the variable there since we need fallbacks for missing characters */
1818
font-family: "IA Writer Duospace", Menlo, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", Courier, monospace !important;
1919
}
2020

2121
/* Maybe users want a setting to normalize any font offered so there is a “a11y Normalize” flag for it */
2222

23-
:root:--font-override:--a11y-font,
23+
:root:--a11y-font,
2424
:root:--a11y-normalize {
2525
font-weight: normal !important;
2626
font-style: normal !important;
2727
}
2828

2929
/* Targeting everything except code. Note that Open Dyslexic has a monospaced font for code */
30-
:root:--font-override:--a11y-font *:not(code):not(var):not(kbd):not(samp),
30+
:root:--a11y-font *:not(code):not(var):not(kbd):not(samp),
3131
:root:--a11y-normalize *:not(code):not(var):not(kbd):not(samp) {
3232
font-family: inherit !important;
3333
font-weight: inherit !important;
3434
font-style: inherit !important;
3535
}
3636

3737
/* Normalizing text-decoration, subs and sups */
38-
:root:--font-override:--a11y-font *,
38+
:root:--a11y-font *,
3939
:root:--a11y-normalize * {
4040
text-decoration: none !important;
4141
font-variant-caps: normal !important;
4242
font-variant-position: normal !important;
4343
font-variant-numeric: normal !important;
4444
}
4545

46-
:root:--font-override:--a11y-font sup,
46+
:root:--a11y-font sup,
4747
:root:--a11y-normalize sup,
48-
:root:--font-override:--a11y-font sub,
48+
:root:--a11y-font sub,
4949
:root:--a11y-normalize sub {
5050
font-size: 1rem !important;
5151
vertical-align: baseline !important;

css/src/modules/user-settings-submodules/ReadiumCSS-fontFamily_pref.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
Font Family pref
33
44
A submodule managing font-family for user settings
5-
Part of “User Overrides” class – “font override” flag required.
5+
Part of “User Overrides” class – no flag required.
66
77
Repo: https://github.com/readium/css */
88

9-
:root:--font-override[style*="--USER__fontFamily"] {
9+
:root[style*="--USER__fontFamily"] {
1010
font-family: var(--USER__fontFamily) !important;
1111
}
1212

1313
/* We are using revert instead of inherit as Firefox zoom implementation will break
1414
as soon as font-family is set to an element, including value inherit */
15-
:root:--font-override[style*="--USER__fontFamily"] * {
15+
:root[style*="--USER__fontFamily"] * {
1616
font-family: revert !important;
1717
}

css/src/modules/user-settings-submodules/variable-font-submodules/ReadiumCSS-fontOpticalSizing_pref.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
Font optical sizing pref
33
44
A submodule managing font optical sizing for user settings
5-
Part of “User Overrides” class – “font override” flag required.
5+
Part of “User Overrides” class – no flag required.
66
77
Repo: https://github.com/readium/css */
88

9-
:root:--font-override[style*="--USER__fontOpticalSizing"] body {
9+
:root[style*="--USER__fontOpticalSizing"] body {
1010
font-optical-sizing: var(--USER__fontOpticalSizing) !important;
1111
}

css/src/modules/user-settings-submodules/variable-font-submodules/ReadiumCSS-fontWeight_pref.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
Font weight pref
33
44
A submodule managing font weight for user settings
5-
Part of “User Overrides” class – “font override” flag required.
5+
Part of “User Overrides” class – no flag required.
66
77
Repo: https://github.com/readium/css */
88

9-
:root:--font-override[style*="--USER__fontWeight"] body {
9+
:root[style*="--USER__fontWeight"] body {
1010
font-weight: var(--USER__fontWeight) !important;
1111
}
1212

1313
/* Attempt to handle known bolds */
14-
:root:--font-override[style*="--USER__fontWeight"] b,
15-
:root:--font-override[style*="--USER__fontWeight"] strong {
14+
:root[style*="--USER__fontWeight"] b,
15+
:root[style*="--USER__fontWeight"] strong {
1616
font-weight: bolder;
1717
}

css/src/modules/user-settings-submodules/variable-font-submodules/ReadiumCSS-fontWidth_pref.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
Font width pref
33
44
A submodule managing font width for user settings
5-
Part of “User Overrides” class – “font override” flag required.
5+
Part of “User Overrides” class – no flag required.
66
77
Repo: https://github.com/readium/css */
88

9-
:root:--font-override[style*="--USER__fontWidth"] body {
9+
:root[style*="--USER__fontWidth"] body {
1010
font-stretch: var(--USER__fontWidth) !important;
1111
}

docs/CSS11-overrides_classification.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The following settings are optional but should be applied by any means necessary
3131

3232
The following settings are required and should be applied with their required flag by any means necessary:
3333

34-
- font-family (requires `:--font-override` flag);
34+
- font-family;
3535
- font-size.
3636

3737
## User overrides advanced
@@ -47,9 +47,9 @@ The following settings are optional but should be applied by any means necessary
4747
- arabic ligatures;
4848
- hiding ruby (CJK);
4949
- accessibility normalization;
50-
- font optical sizing (requires `:--font-override` flag and a variable font);
51-
- font weight (requires `:--font-override` flag and a variable font);
52-
- font width (requires `:--font-override` flag and a variable font);
50+
- font optical sizing (requires a variable font);
51+
- font weight (requires a variable font);
52+
- font width (requires a variable font);
5353
- image filters.
5454

5555
Please note this classification might change and additional items be added in the future.

docs/CSS12-user_prefs.md

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The `ReadiumCSS-after.css` stylesheet, which contains user settings, can be appe
1717

1818
User settings require the following process:
1919

20-
1. add the flag and its value to `html` when applicable (font override, a11y normalization);
20+
1. add the flag and its value to `html` when applicable (e.g. a11y normalization);
2121
2. add the setting-specific variable and its value to `html`;
2222
3. styles are updated live.
2323

@@ -75,20 +75,6 @@ Override class: Chrome (should be applied by any means necessary)
7575

7676
If the flag is not set, ReadiumCSS will fall back to the paged view.
7777

78-
### Font Family override
79-
80-
Acts as an explicit switch to override the publisher’s `font-family`.
81-
82-
```
83-
--USER__fontOverride
84-
```
85-
86-
Supported value: `readium-font-on`
87-
88-
Override class: None. This flag is required to change the `font-family` user setting.
89-
90-
To switch back to the publisher’s font, you can either set an empty string as a value or remove the property.
91-
9278
### Toggling the Deprecated Implementation of the Font Size Setting
9379

9480
Allows to switch to the Deprecated Implementation of the Font Size Setting from version 1.
@@ -299,7 +285,7 @@ Possible values: `var(--RS__oldStyleTf)` | `var(--RS__modernTf)` | `var(--RS__sa
299285

300286
For Japanese, possible values become: `var(--RS__serif-ja)` (horizontal writing) | `var(--RS__sans-serif-ja)` (horizontal writing) | `var(--RS__serif-ja-v)` (vertical writing) | `var(--RS__sans-serif-ja-v)` (vertical writing) | `<string>`
301287

302-
Required flag: `--USER__fontOverride: readium-font-on`
288+
Required flag: none
303289

304290
Override class: User settings (should be applied by any means necessary)
305291

@@ -409,7 +395,7 @@ When optical sizing is used, small text sizes are often rendered with thicker st
409395

410396
Possible values: `none` | `auto` (default)
411397

412-
Required flag: `--USER__fontOverride: readium-font-on`
398+
Required flag: none
413399

414400
Override class: User settings advanced (optional but should be applied by any means necessary if provided to users)
415401

@@ -423,7 +409,7 @@ Possible values: `number` e.g. `230`, `400`, `750`
423409

424410
**Warning: possible values depend on the variable font you may be using.** You can use services such as [Wakamai Fondue](https://wakamaifondue.com) to get the values.
425411

426-
Required flag: `--USER__fontOverride: readium-font-on`
412+
Required flag: none
427413

428414
Override class: User settings advanced (optional but should be applied by any means necessary if provided to users)
429415

@@ -437,7 +423,7 @@ Possible values: `ultra-condensed` | `extra-condensed` | `condensed` | `semi-con
437423

438424
**Warning: the percentage values depend on the variable font you may be using.** You can use services such as [Wakamai Fondue](https://wakamaifondue.com) to get the values.
439425

440-
Required flag: `--USER__fontOverride: readium-font-on`
426+
Required flag: none
441427

442428
Override class: User settings advanced (optional but should be applied by any means necessary if provided to users)
443429

docs/CSS19-api.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,6 @@ Scope: `html`
6262

6363
Override class: Chrome (should be applied by any means necessary)
6464

65-
* * *
66-
67-
```
68-
:--font-override
69-
```
70-
71-
Preset: `--USER__fontOverride: readium-font-on`
72-
73-
Scope: `html`
74-
75-
Override class: None. This flag is required to change the `font-family` user setting.
76-
7765
* * *
7866

7967
```

0 commit comments

Comments
 (0)