-
Notifications
You must be signed in to change notification settings - Fork 19
/
ReadiumCSS-night_mode.css
72 lines (55 loc) 路 1.89 KB
/
ReadiumCSS-night_mode.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/* Readium CSS
Night mode
A preset theme for night mode
Repo: https://github.com/readium/readium-css */
/* CONFIG */
/* [style*="--USER__appearance"] can be used to increase specificity but performance hit */
:root:--night-mode {
--RS__backgroundColor: #000000;
--RS__textColor: #FEFEFE;
--RS__linkColor: #63caff;
--RS__visitedColor: #0099E5;
/* This can be customized but initial will re-use default value of the browser */
--RS__selectionBackgroundColor: #b4d8fe;
--RS__selectionTextColor: inherit;
}
/* we don鈥檛 need to redeclare bg-color and color for :root since we will inherit and update from day/default mode */
:root:--night-mode *:not(a) {
background-color: transparent !important;
color: inherit !important;
border-color: currentColor !important;
}
:root:--night-mode svg text {
fill: currentColor !important;
stroke: none !important;
}
:root:--night-mode a:link,
:root:--night-mode a:link * {
color: var(--RS__linkColor) !important;
}
:root:--night-mode a:visited,
:root:--night-mode a:visited * {
color: var(--RS__visitedColor) !important;
}
/* For epub:type, in case the contents are served as text/html, namespaces won鈥檛 work hence why we鈥檙e using both syntax */
:root:--night-mode img[class*="gaiji"],
:root:--night-mode *[epub\:type~="titlepage"] img:only-child,
:root:--night-mode *[epub|type~="titlepage"] img:only-child {
-webkit-filter: invert(100%);
filter: invert(100%);
}
/* Darken all images on user鈥檚 demand */
:root:--night-mode:--darken-filter img {
-webkit-filter: brightness(80%);
filter: brightness(80%);
}
/* Invert all images on user鈥檚 demand */
:root:--night-mode:--invert-filter img {
-webkit-filter: invert(100%);
filter: invert(100%);
}
/* Darken and invert on user鈥檚 demand */
:root:--night-mode:--darken-filter:--invert-filter img {
-webkit-filter: brightness(80%) invert(100%);
filter: brightness(80%) invert(100%);
}