UNPKG

@readium/css

Version:

A set of reference stylesheets for EPUB Reading Systems

575 lines (456 loc) 16.4 kB
/* * 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 !important; } :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:100%; height:100vh; max-width:100%; max-height:100vh; min-width:100%; min-height:100vh; padding:0 !important; margin:0 !important; font-size:1rem !important; box-sizing:border-box; hanging-punctuation:last allow-end; -webkit-touch-callout:none; -ms-writing-mode:tb-rl; -webkit-writing-mode:vertical-rl; writing-mode:vertical-rl; } :root:lang(mn-Mong){ -ms-writing-mode:tb; -webkit-writing-mode:vertical-lr; writing-mode:vertical-lr; } body{ width:100%; max-height:var(--RS__defaultLineLength) !important; padding:var(--RS__pageGutter) 0 !important; margin:auto 0 !important; 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"], :root[style*="readium-noVerticalPagination-on"]{ -webkit-columns:auto auto !important; -moz-columns:auto auto !important; columns:auto auto !important; width:auto !important; max-width:none !important; max-height:100vh !important; min-width:0 !important; } :root[style*="readium-scroll-on"] body, :root[style*="readium-noVerticalPagination-on"] body{ max-width:var(--RS__defaultLineLength) !important; box-sizing:border-box !important; } @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) !important; } :root[style*="readium-scroll-on"][style*="--RS__scrollPaddingBottom"] body{ padding-bottom:var(--RS__scrollPaddingBottom) !important; } :root[style*="readium-scroll-on"][style*="--RS__scrollPaddingLeft"] body{ padding-left:var(--RS__scrollPaddingLeft) !important; } :root[style*="readium-scroll-on"][style*="--RS__scrollPaddingRight"] body{ padding-right:var(--RS__scrollPaddingRight) !important; } :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 !important; background-color:transparent !important; border-color:currentcolor !important; } :root[style*="readium-night-on"] svg text{ fill:currentcolor !important; stroke:none !important; } :root[style*="readium-night-on"] a:link, :root[style*="readium-night-on"] a:link *{ color:var(--RS__linkColor) !important; } :root[style*="readium-night-on"] a:visited, :root[style*="readium-night-on"] a:visited *{ color:var(--RS__visitedColor) !important; } :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 !important; background-color:transparent !important; } :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 !important; background-color:window !important; } :root :not(#\#):not(#\#):not(#\#), :root :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#) :root :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#){ color:inherit !important; background-color:inherit !important; } .readiumCSS-mo-active-default{ color:highlightText !important; background-color:highlight !important; } } @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 !important; filter:none !important; } :root[style*="readium-night-on"][style*="readium-invert-on"] img{ -webkit-filter:none !important; filter:none !important; } :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 !important; filter:none !important; } :root[style*="readium-night-on"][style*="readium-invert-on"] img{ -webkit-filter:none !important; filter:none !important; } :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) !important; } :root[style*="--USER__backgroundColor"] *{ background-color:transparent !important; } :root[style*="--USER__textColor"]{ color:var(--USER__textColor) !important; } :root[style*="--USER__textColor"] *:not(a){ color:inherit !important; background-color:transparent !important; border-color:currentcolor !important; } :root[style*="--USER__textColor"] svg text{ fill:currentcolor !important; stroke:none !important; } :root[style*="--USER__linkColor"] a:link, :root[style*="--USER__linkColor"] a:link *{ color:var(--USER__linkColor) !important; } :root[style*="--USER__visitedColor"] a:visited, :root[style*="--USER__visitedColor"] a:visited *{ color:var(--USER__visitedColor) !important; } :root[style*="--USER__selectionBackgroundColor"][style*="--USER__selectionTextColor"] ::-moz-selection{ color:var(--USER__selectionTextColor) !important; background-color:var(--USER__selectionBackgroundColor) !important; } :root[style*="--USER__selectionBackgroundColor"][style*="--USER__selectionTextColor"] ::selection{ color:var(--USER__selectionTextColor) !important; background-color:var(--USER__selectionBackgroundColor) !important; } :root[style*="--USER__lineLength"] body{ max-height:var(--USER__lineLength) !important; } :root[style*="--USER__fontFamily"]{ font-family:var(--USER__fontFamily) !important; } :root[style*="--USER__fontFamily"] *{ font-family:revert !important; } :root:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] body{ zoom:var(--USER__fontSize) !important; } :root[style*="readium-iOSPatch-on"][style*="--USER__fontSize"] body{ -webkit-text-size-adjust:var(--USER__fontSize) !important; } @supports not (zoom: 1){ :root[style*="--USER__fontSize"]{ font-size:var(--USER__fontSize) !important; } } :root[style*="readium-deprecatedFontSize-on"][style*="--USER__fontSize"]{ font-size:var(--USER__fontSize) !important; } :root[style*="--USER__lineHeight"]{ line-height:var(--USER__lineHeight) !important; } :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-right:var(--USER__paraSpacing) !important; margin-left:var(--USER__paraSpacing) !important; } :root[style*="--USER__fontWeight"] body{ font-weight:var(--USER__fontWeight) !important; } :root[style*="--USER__fontWeight"] b, :root[style*="--USER__fontWeight"] strong{ font-weight:bolder; } :root[style*="--USER__fontWidth"] body{ font-stretch:var(--USER__fontWidth) !important; } :root[style*="--USER__fontOpticalSizing"] body{ font-optical-sizing:var(--USER__fontOpticalSizing) !important; } :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*="readium-noRuby-on"] body rt, :root[style*="readium-noRuby-on"] body rp{ display:none; } :root[style*="readium-blend-on"] svg, :root[style*="readium-blend-on"] img{ background-color:transparent !important; mix-blend-mode:multiply !important; } :root[style*="--USER__darkenImages"] img{ -webkit-filter:brightness(var(--USER__darkenImages)) !important; filter:brightness(var(--USER__darkenImages)) !important; } :root[style*="readium-darken-on"] img{ -webkit-filter:brightness(80%) !important; filter:brightness(80%) !important; } :root[style*="--USER__invertImages"] img{ -webkit-filter:invert(var(--USER__invertImages)) !important; filter:invert(var(--USER__invertImages)) !important; } :root[style*="readium-invert-on"] img{ -webkit-filter:invert(100%) !important; filter:invert(100%) !important; } :root[style*="--USER__darkenImages"][style*="--USER__invertImages"] img{ -webkit-filter:brightness(var(--USER__darkenImages)) invert(var(--USER__invertImages)) !important; filter:brightness(var(--USER__darkenImages)) invert(var(--USER__invertImages)) !important; } :root[style*="readium-darken-on"][style*="--USER__invertImages"] img{ -webkit-filter:brightness(80%) invert(var(--USER__invertImages)) !important; filter:brightness(80%) invert(var(--USER__invertImages)) !important; } :root[style*="--USER__darkenImages"][style*="readium-invert-on"] img{ -webkit-filter:brightness(var(--USER__darkenImages)) invert(100%) !important; filter:brightness(var(--USER__darkenImages)) invert(100%) !important; } :root[style*="readium-darken-on"][style*="readium-invert-on"] img{ -webkit-filter:brightness(80%) invert(100%) !important; filter:brightness(80%) invert(100%) !important; } :root[style*="--USER__invertGaiji"] img[class*="gaiji"]{ -webkit-filter:invert(var(--USER__invertGaiji)) !important; filter:invert(var(--USER__invertGaiji)) !important; } :root[style*="readium-invertGaiji-on"] img[class*="gaiji"]{ -webkit-filter:invert(100%) !important; filter:invert(100%) !important; } :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 !important; } :root[style*="readium-normalize-on"] h1{ font-size:1.75rem !important; font-size:calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale)) !important; } :root[style*="readium-normalize-on"] h2{ font-size:1.5rem !important; font-size:calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) !important; } :root[style*="readium-normalize-on"] h3{ font-size:1.25rem !important; font-size:calc(1rem * var(--USER__typeScale)) !important; } :root[style*="readium-normalize-on"] h4, :root[style*="readium-normalize-on"] h5, :root[style*="readium-normalize-on"] h6{ font-size:1rem !important; } :root[style*="readium-normalize-on"] small{ font-size:smaller !important; } :root[style*="readium-normalize-on"] sub, :root[style*="readium-normalize-on"] sup{ font-size:67.5% !important; } :root[style*="readium-normalize-on"][style*="--USER__typeScale"] h1{ font-size:calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale)) !important; } :root[style*="readium-normalize-on"][style*="--USER__typeScale"] h2{ font-size:calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) !important; } :root[style*="readium-normalize-on"][style*="--USER__typeScale"] h3{ font-size:calc(1rem * var(--USER__typeScale)) !important; } :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; }