Skip to content

Commit 08ae1a7

Browse files
committed
Correct epub:type selector in night mode + os_a11y
Re #82
1 parent 09399fc commit 08ae1a7

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

css/src/modules/ReadiumCSS-night_mode.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@
4444
color: var(--RS__visitedColor) !important;
4545
}
4646

47+
/* For epub:type, in case the contents are served as text/html, namespaces won’t work hence why we’re using both syntax */
48+
4749
:root:--night-mode img[class*="gaiji"],
48-
:root:--night-mode *[epub\:type~="titlepage"] img:only-child {
50+
:root:--night-mode *[epub\:type~="titlepage"] img:only-child,
51+
:root:--night-mode *[epub|type~="titlepage"] img:only-child {
4952
-webkit-filter: invert(100%);
5053
filter: invert(100%);
5154
}

css/src/modules/ReadiumCSS-os_a11y.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535

3636
@media screen and (-ms-high-contrast: white-on-black) {
3737
:root:--night-mode img[class*="gaiji"],
38-
:root:--night-mode *[epub\:type~="titlepage"] img:only-child {
38+
:root:--night-mode *[epub\:type~="titlepage"] img:only-child,
39+
:root:--night-mode *[epub|type~="titlepage"] img:only-child {
3940
-webkit-filter: none !important;
4041
filter: none !important;
4142
}
@@ -52,7 +53,8 @@
5253
/* Will be true on recent versions of iOS and MacOS if inverted setting enabled by the user */
5354
@media screen and (inverted-colors) {
5455
:root:--night-mode img[class*="gaiji"],
55-
:root:--night-mode *[epub\:type~="titlepage"] img:only-child {
56+
:root:--night-mode *[epub\:type~="titlepage"] img:only-child,
57+
:root:--night-mode *[epub|type~="titlepage"] img:only-child {
5658
-webkit-filter: none !important;
5759
filter: none !important;
5860
}

0 commit comments

Comments
 (0)