|
2 | 2 | A11y font pref |
3 | 3 |
|
4 | 4 | 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. |
6 | 6 |
|
7 | 7 | Repo: https://github.com/readium/css */ |
8 | 8 |
|
9 | 9 | /* For AccessibleDfA, we need to normalize font-weight and font-style since only the normal style is available */ |
10 | 10 |
|
11 | | -:root:--font-override[style*="AccessibleDfA"] { |
| 11 | +:root[style*="AccessibleDfA"] { |
12 | 12 | /* We won’t use the variable there since we need fallbacks for missing characters */ |
13 | 13 | font-family: AccessibleDfA, Verdana, Tahoma, "Trebuchet MS", sans-serif !important; |
14 | 14 | } |
15 | 15 |
|
16 | | -:root:--font-override[style*="IA Writer Duospace"] { |
| 16 | +:root[style*="IA Writer Duospace"] { |
17 | 17 | /* We won’t use the variable there since we need fallbacks for missing characters */ |
18 | 18 | font-family: "IA Writer Duospace", Menlo, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", Courier, monospace !important; |
19 | 19 | } |
20 | 20 |
|
21 | 21 | /* Maybe users want a setting to normalize any font offered so there is a “a11y Normalize” flag for it */ |
22 | 22 |
|
23 | | -:root:--font-override:--a11y-font, |
| 23 | +:root:--a11y-font, |
24 | 24 | :root:--a11y-normalize { |
25 | 25 | font-weight: normal !important; |
26 | 26 | font-style: normal !important; |
27 | 27 | } |
28 | 28 |
|
29 | 29 | /* 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), |
31 | 31 | :root:--a11y-normalize *:not(code):not(var):not(kbd):not(samp) { |
32 | 32 | font-family: inherit !important; |
33 | 33 | font-weight: inherit !important; |
34 | 34 | font-style: inherit !important; |
35 | 35 | } |
36 | 36 |
|
37 | 37 | /* Normalizing text-decoration, subs and sups */ |
38 | | -:root:--font-override:--a11y-font *, |
| 38 | +:root:--a11y-font *, |
39 | 39 | :root:--a11y-normalize * { |
40 | 40 | text-decoration: none !important; |
41 | 41 | font-variant-caps: normal !important; |
42 | 42 | font-variant-position: normal !important; |
43 | 43 | font-variant-numeric: normal !important; |
44 | 44 | } |
45 | 45 |
|
46 | | -:root:--font-override:--a11y-font sup, |
| 46 | +:root:--a11y-font sup, |
47 | 47 | :root:--a11y-normalize sup, |
48 | | -:root:--font-override:--a11y-font sub, |
| 48 | +:root:--a11y-font sub, |
49 | 49 | :root:--a11y-normalize sub { |
50 | 50 | font-size: 1rem !important; |
51 | 51 | vertical-align: baseline !important; |
|
0 commit comments