From 0d7562a0f86bd328dcfc95d89e1ebe23ddb00562 Mon Sep 17 00:00:00 2001 From: Tony Bark Date: Sun, 29 Sep 2024 11:01:15 -0400 Subject: [PATCH] Added css --- book.css | 262 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 262 insertions(+) create mode 100644 book.css diff --git a/book.css b/book.css new file mode 100644 index 0000000..f6bc1d3 --- /dev/null +++ b/book.css @@ -0,0 +1,262 @@ +@charset "utf-8"; +@namespace epub "http://www.idpf.org/2007/ops"; + +body { + font-variant-numeric: oldstyle-nums; + hyphens: auto; + -epub-hyphens: auto; + text-wrap: pretty; +} + +p { + margin: 0; + text-indent: 1em; +} + +hr { + border: none; + border-top: 1px solid; + height: 0; + margin: 1.5em auto; + width: 25%; +} + +q::before, +q::after { + content: ""; +} + +blockquote { + margin: 1em 2.5em; +} + +h1, +h2, +h3, +h4, +h5, +h6, +hgroup { + break-after: avoid; + break-inside: avoid; + font-variant: small-caps; + hyphens: none; + -epub-hyphens: none; + margin: 3em 0; + text-align: center; +} + +/* simulate h3 in an hgroup */ +hgroup h2 + p { + font-size: 1.17em; +} + +/* simulate h4 in an hgroup */ +hgroup h2 + p + p, +hgroup h3 + p { + font-size: 1em; +} + +/* simulate h5 in an hgroup */ +hgroup h2 + p + p + p, +hgroup h3 + p + p, +hgroup h4 + p { + font-size: 0.83em; +} + +/* simulate h6 in an hgroup */ +hgroup h2 + p + p + p + p, +hgroup h3 + p + p + p, +hgroup h4 + p + p, +hgroup h5 + p { + font-size: 0.67em; +} + +hgroup > * { + font-weight: normal; + margin: 0; +} + +hgroup > *:first-child { + font-weight: bold; +} + +hgroup > p { + text-indent: 0; +} + +p.continued, +h2 + p, +h3 + p, +h4 + p, +h5 + p, +h6 + p, +header + p, +hr + p, +hgroup + p, +p:first-child { + hanging-punctuation: first last; + text-indent: 0; +} + +cite { + font-style: normal; +} + +abbr { + border: none; + white-space: nowrap; +} + +blockquote cite { + display: block; + font-style: italic; + text-align: right; +} + +blockquote cite i { + font-style: normal; +} + +b, +strong { + font-variant: small-caps; + font-weight: normal; +} + +i > i, +em > i, +i > em { + font-style: normal; +} + +ol, +ul { + margin-bottom: 1em; + margin-top: 1em; +} + +header { + break-after: avoid; + break-inside: avoid; + hyphens: none; + -epub-hyphens: none; + text-align: center; +} + +header > * + p { + text-indent: 0; +} + +article > header + *, +section > header + * { + margin-top: 3em; +} + +a[epub|type~="noteref"] { + font-size: 0.75em; + font-style: normal !important; + vertical-align: super; +} + +section[epub|type~="endnotes"] > ol > li { + margin: 1em 0; +} + +/* This may appear in the colophon */ +abbr[epub|type~="se:era"] { + font-variant: all-small-caps; +} + +section[epub|type~="titlepage"] h1, +section[epub|type~="titlepage"] p, +section[epub|type~="colophon"] h2, +section[epub|type~="imprint"] h2 { + left: -999em; + position: absolute; +} + +section[epub|type~="titlepage"] img { + display: block; + margin: 3em auto auto auto; + width: 100%; +} + +section[epub|type~="colophon"], +section[epub|type~="imprint"] { + text-align: center; +} + +section[epub|type~="colophon"] header, +section[epub|type~="imprint"] header { + line-height: 0; + margin-top: 3em; +} + +img[epub|type~="z3998:publisher-logo"] { + max-width: 25%; + width: 220px; +} + +section[epub|type~="colophon"] p, +section[epub|type~="imprint"] p { + margin: 1em auto 0 auto; + text-indent: 0; +} + +section[epub|type~="imprint"] p { + font-size: 0.75em; + text-align: justify; + width: 75%; +} + +section[epub|type~="colophon"] p + p::before { + border-top: 1px solid; + content: ""; + display: block; + margin: auto auto 1em auto; + width: 25%; +} + +section[epub|type~="colophon"] a { + font-variant: small-caps; +} + +section[epub|type~="imprint"] a, +section[epub|type~="colophon"] a { + hyphens: none; + -epub-hyphens: none; +} + +section[epub|type~="copyright-page"] p { + margin: 1em auto; + text-indent: 0; +} + +section[epub|type~="copyright-page"] blockquote p { + font-style: italic; + text-align: initial; + text-indent: 0; +} + +section[epub|type~="copyright-page"] blockquote p span { + display: block; + padding-left: 1em; + text-indent: -1em; +} + +section[epub|type~="copyright-page"] blockquote br { + display: none; +} + +/* Invert images in dark mode. RMSDK requires a target media as well as a state. */ +@media all and (prefers-color-scheme: dark) { + img[epub|type~="se:image.color-depth.black-on-transparent"] { + filter: invert(100%); + } + + img[epub|type~="se:image.color-depth.black-on-transparent"][epub|type~="se:image.style.realistic"] { + background: currentColor; + filter: none; + } +}