@readium/css
Version:
A set of reference stylesheets for EPUB Reading Systems
46 lines (34 loc) • 1.19 kB
CSS
/* Readium CSS
Night mode
A preset theme for night mode
Repo: https://github.com/readium/css */
/* CONFIG */
/* [style*="--USER__appearance"] can be used to increase specificity but performance hit */
:root:--night-mode {
@import-json "../../vars/night.json";
}
/* we don’t need to redeclare bg-color and color for :root since we will inherit and update from base */
:root:--night-mode *:not(a) {
background-color: transparent ;
color: inherit ;
border-color: currentColor ;
}
:root:--night-mode svg text {
fill: currentColor ;
stroke: none ;
}
:root:--night-mode a:link,
:root:--night-mode a:link * {
color: var(--RS__linkColor) ;
}
:root:--night-mode a:visited,
:root:--night-mode a:visited * {
color: var(--RS__visitedColor) ;
}
/* For epub:type, in case the contents are served as text/html, namespaces won’t work hence why we’re 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%);
}