Skip to content

Commit f0b978d

Browse files
committed
Protect against corner cases
- Book setting letter and wod spacing with !important - section/div with line-height or hyphens, etc.
1 parent 8de9c42 commit f0b978d

4 files changed

Lines changed: 9 additions & 10 deletions

File tree

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@
1616
hyphens: var(--USER__bodyHyphens) !important;
1717
}
1818

19-
/* Sorry, we can’t use `:matches`, `:-moz-any` or `:-webkit-any` because MS doesn’t support it yet */
2019
:root[style*="--USER__bodyHyphens"] body,
2120
:root[style*="--USER__bodyHyphens"] p,
2221
:root[style*="--USER__bodyHyphens"] li,
2322
:root[style*="--USER__bodyHyphens"] div,
2423
:root[style*="--USER__bodyHyphens"] dd {
25-
-webkit-hyphens: inherit;
26-
-moz-hyphens: inherit;
27-
-ms-hyphens: inherit;
28-
-epub-hyphens: inherit;
29-
hyphens: inherit;
24+
-webkit-hyphens: var(--USER__bodyHyphens) !important;
25+
-moz-hyphens: var(--USER__bodyHyphens) !important;
26+
-ms-hyphens: var(--USER__bodyHyphens) !important;
27+
-epub-hyphens: var(--USER__bodyHyphens) !important;
28+
hyphens: var(--USER__bodyHyphens) !important;
3029
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
:root[style*="--USER__letterSpacing"] div,
1818
:root[style*="--USER__letterSpacing"] dt,
1919
:root[style*="--USER__letterSpacing"] dd {
20-
letter-spacing: var(--USER__letterSpacing);
21-
font-variant: none;
20+
letter-spacing: var(--USER__letterSpacing) !important;
21+
font-variant: none !important;
2222
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
:root[style*="--USER__lineHeight"] p,
1515
:root[style*="--USER__lineHeight"] li,
1616
:root[style*="--USER__lineHeight"] div {
17-
line-height: inherit;
17+
line-height: var(--USER__lineHeight) !important;
1818
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
:root[style*="--USER__wordSpacing"] div,
1818
:root[style*="--USER__wordSpacing"] dt,
1919
:root[style*="--USER__wordSpacing"] dd {
20-
word-spacing: var(--USER__wordSpacing);
20+
word-spacing: var(--USER__wordSpacing) !important;
2121
}

0 commit comments

Comments
 (0)