@readium/css
Version:
A set of reference stylesheets for EPUB Reading Systems
680 lines (546 loc) • 19.8 kB
CSS
/*
* Readium CSS (v. 2.0.0-beta.18)
* Developers: Jiminy Panoz
* Copyright (c) 2017. Readium Foundation. All rights reserved.
* Use of this source code is governed by a BSD-style license which is detailed in the
* LICENSE file present in the project repository where this source code is maintained.
*/
@namespace url("http://www.w3.org/1999/xhtml");
@namespace epub url("http://www.idpf.org/2007/ops");
@namespace m url("http://www.w3.org/1998/Math/MathML");
@namespace svg url("http://www.w3.org/2000/svg");
:root{
--RS__viewportWidth:100%;
--RS__pageGutter:0;
--RS__defaultLineLength:40rem;
--RS__colGap:0;
--RS__colCount:1;
--RS__colWidth:100vw;
}
@page{
margin:0 ;
}
:root{
position:relative;
-webkit-column-width:var(--RS__colWidth);
-moz-column-width:var(--RS__colWidth);
column-width:var(--RS__colWidth);
-webkit-column-count:var(--RS__colCount);
-moz-column-count:var(--RS__colCount);
column-count:var(--RS__colCount);
-webkit-column-gap:var(--RS__colGap);
-moz-column-gap:var(--RS__colGap);
column-gap:var(--RS__colGap);
-moz-column-fill:auto;
column-fill:auto;
width:var(--RS__viewportWidth);
height:100vh;
max-width:var(--RS__viewportWidth);
max-height:100vh;
min-width:var(--RS__viewportWidth);
min-height:100vh;
padding:0 ;
margin:0 ;
font-size:1rem ;
box-sizing:border-box;
-webkit-touch-callout:none;
}
body{
width:100%;
max-width:var(--RS__defaultLineLength) ;
padding:0 var(--RS__pageGutter) ;
margin:0 auto ;
box-sizing:border-box;
}
:root:not([style*="readium-noOverflow-on"]) body{
overflow:hidden;
}
@supports (overflow: clip){
:root:not([style*="readium-noOverflow-on"]){
overflow:clip;
}
:root:not([style*="readium-noOverflow-on"]) body{
overflow:clip;
overflow-clip-margin:content-box;
}
}
:root[style*="readium-scroll-on"]{
-webkit-columns:auto auto ;
-moz-columns:auto auto ;
columns:auto auto ;
width:auto ;
height:auto ;
max-width:none ;
max-height:none ;
min-width:0 ;
min-height:0 ;
}
:root[style*="readium-scroll-on"] body{
max-width:var(--RS__defaultLineLength) ;
box-sizing:border-box ;
}
:root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]) body{
overflow:auto;
}
@supports (overflow: clip){
:root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]){
overflow:auto;
}
:root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]) body{
overflow:clip;
}
}
:root[style*="readium-scroll-on"][style*="--RS__scrollPaddingTop"] body{
padding-top:var(--RS__scrollPaddingTop) ;
}
:root[style*="readium-scroll-on"][style*="--RS__scrollPaddingBottom"] body{
padding-bottom:var(--RS__scrollPaddingBottom) ;
}
:root[style*="readium-scroll-on"][style*="--RS__scrollPaddingLeft"] body{
padding-left:var(--RS__scrollPaddingLeft) ;
}
:root[style*="readium-scroll-on"][style*="--RS__scrollPaddingRight"] body{
padding-right:var(--RS__scrollPaddingRight) ;
}
:root[style*="readium-night-on"]{
--RS__selectionTextColor:inherit;
--RS__selectionBackgroundColor:#b4d8fe;
--RS__visitedColor:#0099E5;
--RS__linkColor:#63caff;
--RS__textColor:#FEFEFE;
--RS__backgroundColor:#000000;
}
:root[style*="readium-night-on"] *:not(a){
color:inherit ;
background-color:transparent ;
border-color:currentcolor !important;
}
:root[style*="readium-night-on"] svg text{
fill:currentcolor !important;
stroke:none ;
}
:root[style*="readium-night-on"] a:link,
:root[style*="readium-night-on"] a:link *{
color:var(--RS__linkColor) ;
}
:root[style*="readium-night-on"] a:visited,
:root[style*="readium-night-on"] a:visited *{
color:var(--RS__visitedColor) ;
}
:root[style*="readium-night-on"] img[class*="gaiji"],
:root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child,
:root[style*="readium-night-on"] *[epub|type~="titlepage"] img:only-child{
-webkit-filter:invert(100%);
filter:invert(100%);
}
:root[style*="readium-sepia-on"]{
--RS__selectionTextColor:inherit;
--RS__selectionBackgroundColor:#b4d8fe;
--RS__visitedColor:#551A8B;
--RS__linkColor:#0000EE;
--RS__textColor:#121212;
--RS__backgroundColor:#faf4e8;
}
:root[style*="readium-sepia-on"] *:not(a){
color:inherit ;
background-color:transparent ;
}
:root[style*="readium-sepia-on"] a:link,
:root[style*="readium-sepia-on"] a:link *{
color:var(--RS__linkColor);
}
:root[style*="readium-sepia-on"] a:visited,
:root[style*="readium-sepia-on"] a:visited *{
color:var(--RS__visitedColor);
}
@media screen and (-ms-high-contrast: active){
:root{
color:windowText ;
background-color:window ;
}
:root :not(#\#):not(#\#):not(#\#),
:root :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#)
:root :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#){
color:inherit ;
background-color:inherit ;
}
.readiumCSS-mo-active-default{
color:highlightText ;
background-color:highlight ;
}
}
@media screen and (-ms-high-contrast: white-on-black){
:root[style*="readium-night-on"] img[class*="gaiji"],
:root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child,
:root[style*="readium-night-on"] *[epub|type~="titlepage"] img:only-child{
-webkit-filter:none ;
filter:none ;
}
:root[style*="readium-night-on"][style*="readium-invert-on"] img{
-webkit-filter:none ;
filter:none ;
}
:root[style*="readium-night-on"][style*="readium-darken-on"][style*="readium-invert-on"] img{
-webkit-filter:brightness(80%);
filter:brightness(80%);
}
}
@media screen and (inverted-colors){
:root[style*="readium-night-on"] img[class*="gaiji"],
:root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child,
:root[style*="readium-night-on"] *[epub|type~="titlepage"] img:only-child{
-webkit-filter:none ;
filter:none ;
}
:root[style*="readium-night-on"][style*="readium-invert-on"] img{
-webkit-filter:none ;
filter:none ;
}
:root[style*="readium-night-on"][style*="readium-darken-on"][style*="readium-invert-on"] img{
-webkit-filter:brightness(80%);
filter:brightness(80%);
}
}
@media screen and (monochrome){
}
@media screen and (prefers-reduced-motion){
}
:root[style*="--USER__backgroundColor"]{
background-color:var(--USER__backgroundColor) ;
}
:root[style*="--USER__backgroundColor"] *{
background-color:transparent ;
}
:root[style*="--USER__textColor"]{
color:var(--USER__textColor) ;
}
:root[style*="--USER__textColor"] *:not(a){
color:inherit ;
background-color:transparent ;
border-color:currentcolor !important;
}
:root[style*="--USER__textColor"] svg text{
fill:currentcolor !important;
stroke:none ;
}
:root[style*="--USER__linkColor"] a:link,
:root[style*="--USER__linkColor"] a:link *{
color:var(--USER__linkColor) ;
}
:root[style*="--USER__visitedColor"] a:visited,
:root[style*="--USER__visitedColor"] a:visited *{
color:var(--USER__visitedColor) ;
}
:root[style*="--USER__selectionBackgroundColor"][style*="--USER__selectionTextColor"] ::-moz-selection{
color:var(--USER__selectionTextColor) ;
background-color:var(--USER__selectionBackgroundColor) ;
}
:root[style*="--USER__selectionBackgroundColor"][style*="--USER__selectionTextColor"] ::selection{
color:var(--USER__selectionTextColor) ;
background-color:var(--USER__selectionBackgroundColor) ;
}
:root[style*="--USER__colCount"]{
-webkit-column-count:var(--USER__colCount);
-moz-column-count:var(--USER__colCount);
column-count:var(--USER__colCount);
--RS__colWidth:auto;
}
:root[style*="--USER__colCount: 0"],
:root[style*="--USER__colCount:0"]{
-webkit-column-count:1;
-moz-column-count:1;
column-count:1;
}
:root[style*="--USER__colCount: 0"],
:root[style*="--USER__colCount:0"],
:root[style*="--USER__colCount: 1"],
:root[style*="--USER__colCount:1"]{
--RS__colWidth:100vw;
}
:root[style*="--USER__lineLength"] body{
max-width:var(--USER__lineLength) ;
}
:root[style*="--USER__textAlign"]{
text-align:var(--USER__textAlign);
}
:root[style*="--USER__textAlign"] body,
:root[style*="--USER__textAlign"] p:not(blockquote p):not(figcaption p):not(hgroup p),
:root[style*="--USER__textAlign"] li,
:root[style*="--USER__textAlign"] dd{
text-align:var(--USER__textAlign) ;
-moz-text-align-last:auto ;
-epub-text-align-last:auto ;
text-align-last:auto ;
}
:root[style*="--USER__bodyHyphens"]{
-webkit-hyphens:var(--USER__bodyHyphens) ;
-moz-hyphens:var(--USER__bodyHyphens) ;
-ms-hyphens:var(--USER__bodyHyphens) ;
-epub-hyphens:var(--USER__bodyHyphens) ;
hyphens:var(--USER__bodyHyphens) ;
}
:root[style*="--USER__bodyHyphens"] body,
:root[style*="--USER__bodyHyphens"] p,
:root[style*="--USER__bodyHyphens"] li,
:root[style*="--USER__bodyHyphens"] div,
:root[style*="--USER__bodyHyphens"] dd{
-webkit-hyphens:inherit;
-moz-hyphens:inherit;
-ms-hyphens:inherit;
-epub-hyphens:inherit;
hyphens:inherit;
}
:root[style*="--USER__fontFamily"]{
font-family:var(--USER__fontFamily) ;
}
:root[style*="--USER__fontFamily"] *{
font-family:revert ;
}
:root[style*="AccessibleDfA"]{
font-family:AccessibleDfA, Verdana, Tahoma, "Trebuchet MS", sans-serif ;
}
:root[style*="IA Writer Duospace"]{
font-family:"IA Writer Duospace", Menlo, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", Courier, monospace ;
}
:root[style*="AccessibleDfA"],:root[style*="IA Writer Duospace"],
:root[style*="readium-a11y-on"]{
font-style:normal ;
font-weight:normal ;
}
:root[style*="AccessibleDfA"] *:not(code):not(var):not(kbd):not(samp),:root[style*="IA Writer Duospace"] *:not(code):not(var):not(kbd):not(samp),
:root[style*="readium-a11y-on"] *:not(code):not(var):not(kbd):not(samp){
font-family:inherit ;
font-style:inherit ;
font-weight:inherit ;
}
:root[style*="AccessibleDfA"] *,:root[style*="IA Writer Duospace"] *,
:root[style*="readium-a11y-on"] *{
text-decoration:none ;
font-variant-caps:normal ;
font-variant-numeric:normal ;
font-variant-position:normal ;
}
:root[style*="AccessibleDfA"] sup,:root[style*="IA Writer Duospace"] sup,
:root[style*="readium-a11y-on"] sup,
:root[style*="AccessibleDfA"] sub,
:root[style*="IA Writer Duospace"] sub,
:root[style*="readium-a11y-on"] sub{
font-size:1rem ;
vertical-align:baseline ;
}
:root:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] body{
zoom:var(--USER__fontSize) ;
}
:root[style*="readium-iOSPatch-on"][style*="--USER__fontSize"] body{
-webkit-text-size-adjust:var(--USER__fontSize) ;
}
@supports not (zoom: 1){
:root[style*="--USER__fontSize"]{
font-size:var(--USER__fontSize) ;
}
}
:root[style*="readium-deprecatedFontSize-on"][style*="--USER__fontSize"]{
font-size:var(--USER__fontSize) ;
}
:root[style*="--USER__lineHeight"]{
line-height:var(--USER__lineHeight) ;
}
:root[style*="--USER__lineHeight"] body,
:root[style*="--USER__lineHeight"] p,
:root[style*="--USER__lineHeight"] li,
:root[style*="--USER__lineHeight"] div{
line-height:inherit;
}
:root[style*="--USER__paraSpacing"] p{
margin-top:var(--USER__paraSpacing) ;
margin-bottom:var(--USER__paraSpacing) ;
}
:root[style*="--USER__paraIndent"] p{
text-indent:var(--USER__paraIndent) ;
}
:root[style*="--USER__paraIndent"] p *,
:root[style*="--USER__paraIndent"] p:first-letter{
text-indent:0 ;
}
:root[style*="--USER__wordSpacing"] h1,
:root[style*="--USER__wordSpacing"] h2,
:root[style*="--USER__wordSpacing"] h3,
:root[style*="--USER__wordSpacing"] h4,
:root[style*="--USER__wordSpacing"] h5,
:root[style*="--USER__wordSpacing"] h6,
:root[style*="--USER__wordSpacing"] p,
:root[style*="--USER__wordSpacing"] li,
:root[style*="--USER__wordSpacing"] div,
:root[style*="--USER__wordSpacing"] dt,
:root[style*="--USER__wordSpacing"] dd{
word-spacing:var(--USER__wordSpacing);
}
:root[style*="--USER__letterSpacing"] h1,
:root[style*="--USER__letterSpacing"] h2,
:root[style*="--USER__letterSpacing"] h3,
:root[style*="--USER__letterSpacing"] h4,
:root[style*="--USER__letterSpacing"] h5,
:root[style*="--USER__letterSpacing"] h6,
:root[style*="--USER__letterSpacing"] p,
:root[style*="--USER__letterSpacing"] li,
:root[style*="--USER__letterSpacing"] div,
:root[style*="--USER__letterSpacing"] dt,
:root[style*="--USER__letterSpacing"] dd{
letter-spacing:var(--USER__letterSpacing);
font-variant:none;
}
:root[style*="--USER__fontWeight"] body{
font-weight:var(--USER__fontWeight) ;
}
:root[style*="--USER__fontWeight"] b,
:root[style*="--USER__fontWeight"] strong{
font-weight:bolder;
}
:root[style*="--USER__fontWidth"] body{
font-stretch:var(--USER__fontWidth) ;
}
:root[style*="--USER__fontOpticalSizing"] body{
font-optical-sizing:var(--USER__fontOpticalSizing) ;
}
:root[style*="readium-blend-on"] svg,
:root[style*="readium-blend-on"] img{
background-color:transparent ;
mix-blend-mode:multiply ;
}
:root[style*="--USER__darkenImages"] img{
-webkit-filter:brightness(var(--USER__darkenImages)) ;
filter:brightness(var(--USER__darkenImages)) ;
}
:root[style*="readium-darken-on"] img{
-webkit-filter:brightness(80%) ;
filter:brightness(80%) ;
}
:root[style*="--USER__invertImages"] img{
-webkit-filter:invert(var(--USER__invertImages)) ;
filter:invert(var(--USER__invertImages)) ;
}
:root[style*="readium-invert-on"] img{
-webkit-filter:invert(100%) ;
filter:invert(100%) ;
}
:root[style*="--USER__darkenImages"][style*="--USER__invertImages"] img{
-webkit-filter:brightness(var(--USER__darkenImages)) invert(var(--USER__invertImages)) ;
filter:brightness(var(--USER__darkenImages)) invert(var(--USER__invertImages)) ;
}
:root[style*="readium-darken-on"][style*="--USER__invertImages"] img{
-webkit-filter:brightness(80%) invert(var(--USER__invertImages)) ;
filter:brightness(80%) invert(var(--USER__invertImages)) ;
}
:root[style*="--USER__darkenImages"][style*="readium-invert-on"] img{
-webkit-filter:brightness(var(--USER__darkenImages)) invert(100%) ;
filter:brightness(var(--USER__darkenImages)) invert(100%) ;
}
:root[style*="readium-darken-on"][style*="readium-invert-on"] img{
-webkit-filter:brightness(80%) invert(100%) ;
filter:brightness(80%) invert(100%) ;
}
:root[style*="--USER__invertGaiji"] img[class*="gaiji"]{
-webkit-filter:invert(var(--USER__invertGaiji)) ;
filter:invert(var(--USER__invertGaiji)) ;
}
:root[style*="readium-invertGaiji-on"] img[class*="gaiji"]{
-webkit-filter:invert(100%) ;
filter:invert(100%) ;
}
:root[style*="readium-normalize-on"]{
--USER__typeScale:1.2;
}
:root[style*="readium-normalize-on"] p,
:root[style*="readium-normalize-on"] li,
:root[style*="readium-normalize-on"] div,
:root[style*="readium-normalize-on"] pre,
:root[style*="readium-normalize-on"] dd{
font-size:1rem ;
}
:root[style*="readium-normalize-on"] h1{
font-size:1.75rem ;
font-size:calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale)) ;
}
:root[style*="readium-normalize-on"] h2{
font-size:1.5rem ;
font-size:calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) ;
}
:root[style*="readium-normalize-on"] h3{
font-size:1.25rem ;
font-size:calc(1rem * var(--USER__typeScale)) ;
}
:root[style*="readium-normalize-on"] h4,
:root[style*="readium-normalize-on"] h5,
:root[style*="readium-normalize-on"] h6{
font-size:1rem ;
}
:root[style*="readium-normalize-on"] small{
font-size:smaller ;
}
:root[style*="readium-normalize-on"] sub,
:root[style*="readium-normalize-on"] sup{
font-size:67.5% ;
}
:root[style*="readium-normalize-on"][style*="--USER__typeScale"] h1{
font-size:calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale)) ;
}
:root[style*="readium-normalize-on"][style*="--USER__typeScale"] h2{
font-size:calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) ;
}
:root[style*="readium-normalize-on"][style*="--USER__typeScale"] h3{
font-size:calc(1rem * var(--USER__typeScale)) ;
}
:root[style*="readium-iPadOSPatch-on"] body{
-webkit-text-size-adjust:none;
}
:root[style*="readium-iPadOSPatch-on"] p,
:root[style*="readium-iPadOSPatch-on"] h1,
:root[style*="readium-iPadOSPatch-on"] h2,
:root[style*="readium-iPadOSPatch-on"] h3,
:root[style*="readium-iPadOSPatch-on"] h4,
:root[style*="readium-iPadOSPatch-on"] h5,
:root[style*="readium-iPadOSPatch-on"] h6,
:root[style*="readium-iPadOSPatch-on"] li,
:root[style*="readium-iPadOSPatch-on"] th,
:root[style*="readium-iPadOSPatch-on"] td,
:root[style*="readium-iPadOSPatch-on"] dt,
:root[style*="readium-iPadOSPatch-on"] dd,
:root[style*="readium-iPadOSPatch-on"] pre,
:root[style*="readium-iPadOSPatch-on"] address,
:root[style*="readium-iPadOSPatch-on"] details,
:root[style*="readium-iPadOSPatch-on"] summary,
:root[style*="readium-iPadOSPatch-on"] figcaption,
:root[style*="readium-iPadOSPatch-on"] div:not(:has(p, h1, h2, h3, h4, h5, h6, li, th, td, dt, dd, pre, address, aside, details, figcaption, summary)),
:root[style*="readium-iPadOSPatch-on"] aside:not(:has(p, h1, h2, h3, h4, h5, h6, li, th, td, dt, dd, pre, address, aside, details, figcaption, summary)){
-webkit-text-zoom:reset;
}
:root[style*="readium-iPadOSPatch-on"] abbr,
:root[style*="readium-iPadOSPatch-on"] b,
:root[style*="readium-iPadOSPatch-on"] bdi,
:root[style*="readium-iPadOSPatch-on"] bdo,
:root[style*="readium-iPadOSPatch-on"] cite,
:root[style*="readium-iPadOSPatch-on"] code,
:root[style*="readium-iPadOSPatch-on"] dfn,
:root[style*="readium-iPadOSPatch-on"] em,
:root[style*="readium-iPadOSPatch-on"] i,
:root[style*="readium-iPadOSPatch-on"] kbd,
:root[style*="readium-iPadOSPatch-on"] mark,
:root[style*="readium-iPadOSPatch-on"] q,
:root[style*="readium-iPadOSPatch-on"] rp,
:root[style*="readium-iPadOSPatch-on"] rt,
:root[style*="readium-iPadOSPatch-on"] ruby,
:root[style*="readium-iPadOSPatch-on"] s,
:root[style*="readium-iPadOSPatch-on"] samp,
:root[style*="readium-iPadOSPatch-on"] small,
:root[style*="readium-iPadOSPatch-on"] span,
:root[style*="readium-iPadOSPatch-on"] strong,
:root[style*="readium-iPadOSPatch-on"] sub,
:root[style*="readium-iPadOSPatch-on"] sup,
:root[style*="readium-iPadOSPatch-on"] time,
:root[style*="readium-iPadOSPatch-on"] u,
:root[style*="readium-iPadOSPatch-on"] var{
-webkit-text-zoom:normal;
}
:root[style*="readium-iPadOSPatch-on"] p:not(:has(b, cite, em, i, q, s, small, span, strong)):first-line{
-webkit-text-zoom:normal;
}