Search / static /reader.css
vomebook
fix: remove redundant PDF loading overlays
9ed8d43
Raw History Blame Contribute Delete
33.3 kB
/* Base and toolbar */
:root {
--reader-toolbar-height: 44px;
--reader-popover-top: 92px;
--reader-focus-color: #8ab4f8;
--reader-theme-duration: 0s;
color-scheme: dark;
font-family: system-ui, sans-serif;
background: #111315;
color: #eceff1;
}
* {
box-sizing: border-box;
letter-spacing: 0;
}
body {
margin: 0;
height: 100vh;
height: 100dvh;
overflow: hidden;
display: flex;
flex-direction: column;
}
.reader-toolbar {
min-height: var(--reader-toolbar-height);
flex: none;
display: flex;
align-items: center;
gap: 7px;
padding: 3px 10px;
background: #1b1e21;
border-bottom: 1px solid #34383d;
}
.reader-toolbar,
.reader-panel,
.reader-progress-tools,
.reader-page {
user-select: none;
-webkit-user-select: none;
}
.reader-heading {
min-width: 0;
flex: 1;
display: flex;
flex-direction: column;
}
.reader-heading strong {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 14px;
line-height: 18px;
}
.reader-heading span,
.reader-path {
color: #9ba3aa;
font-size: 12px;
line-height: 16px;
}
.reader-path {
min-width: 0;
max-width: 100%;
padding: 0;
border: 0;
background: transparent;
font-family: inherit;
text-align: left;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
}
.reader-path:hover,
.reader-path:focus-visible {
color: #d5d9dc;
text-decoration: underline;
outline: none;
}
.reader-actions {
position: relative;
display: flex;
align-items: center;
gap: 4px;
}
#download-feedback:not([hidden]) {
position: absolute;
top: calc(100% + 8px);
right: 0;
z-index: 12;
width: max-content;
max-width: min(260px, calc(100vw - 20px));
padding: 8px 10px;
border: 1px solid #555f66;
border-radius: 4px;
background: #25292d;
color: #eceff1;
font-size: 12px;
line-height: 18px;
white-space: normal;
box-shadow: 0 4px 12px #0008;
}
.control-group {
display: inline-flex;
align-items: center;
gap: 2px;
}
.control-group[hidden] {
display: none;
}
.compact-input {
height: 32px;
display: inline-flex;
align-items: center;
border: 1px solid #3b4147;
background: #25292d;
border-radius: 4px;
padding-right: 4px;
color: #c6ccd1;
font-size: 12px;
}
.compact-input input {
width: 34px;
height: 28px;
border: 0;
background: transparent;
color: inherit;
text-align: right;
font: inherit;
outline: none;
}
.icon-button {
width: 32px;
height: 32px;
border: 0;
background: transparent;
color: inherit;
display: inline-grid;
place-items: center;
text-decoration: none;
cursor: pointer;
border-radius: 4px;
font-size: 18px;
}
.text-button {
height: 32px;
padding: 0 8px;
border: 0;
background: transparent;
color: inherit;
display: inline-flex;
align-items: center;
text-decoration: none;
border-radius: 4px;
font-size: 12px;
}
.text-button[hidden] {
display: none;
}
.icon-button:hover,
.text-button:hover {
background: #292d31;
}
/* Drawer, tabs and reading progress */
.reader-panel {
position: fixed;
top: var(--reader-toolbar-height);
right: 0;
bottom: 0;
width: min(400px, 94vw);
z-index: 20;
display: flex;
flex-direction: column;
background: #1b1e21;
border-left: 1px solid #34383d;
box-shadow: -5px 0 20px #0008;
opacity: 0;
visibility: hidden;
transform: translateX(100%);
transition:
transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
opacity 180ms ease,
visibility 0s linear 240ms,
background-color var(--reader-theme-duration) ease,
color var(--reader-theme-duration) ease,
border-color var(--reader-theme-duration) ease;
}
.reader-panel.is-open {
opacity: 1;
visibility: visible;
transform: translateX(0);
transition-delay: 0s;
}
.reader-panel[hidden],
.reader-panel-view[hidden],
.panel-search[hidden],
.panel-item[hidden],
#full-search-clear[hidden] {
display: none;
}
.reader-panel > header {
height: 48px;
flex: none;
display: flex;
align-items: center;
gap: 4px;
padding: 0 6px 0 12px;
border-bottom: 1px solid #34383d;
}
.reader-panel > header > strong {
min-width: 0;
flex: 1;
font-size: 14px;
}
.reader-panel-tabs {
flex: none;
display: flex;
border-bottom: 1px solid #34383d;
}
.reader-panel-tabs button {
flex: 1;
min-height: 38px;
border: 0;
border-bottom: 2px solid transparent;
background: transparent;
color: #aeb5ba;
cursor: pointer;
}
.reader-panel-tabs button[aria-selected="true"] {
color: #e7e9eb;
border-bottom-color: #8ab4f8;
}
.reader-panel-view {
min-height: 0;
flex: 1;
overflow: auto;
}
.reader-progress-tools {
flex: none;
padding: 10px 12px 12px;
border-top: 1px solid #34383d;
background: inherit;
}
.reader-progress-summary {
display: grid;
justify-items: center;
gap: 4px;
padding: 2px 0 10px;
text-align: center;
}
.reader-progress-summary strong {
font-size: 14px;
}
.reader-progress-summary-value {
color: #8ab4f8;
font-size: 20px;
font-variant-numeric: tabular-nums;
}
.reader-progress-bookmark {
padding: 2px 0;
font-size: 12px;
}
.reader-progress-row {
display: grid;
grid-template-columns: auto minmax(0, 1fr) auto auto auto;
align-items: center;
gap: 7px;
min-width: 0;
}
.reader-no-toc .reader-progress-row {
grid-template-columns: minmax(0, 420px) auto;
justify-content: center;
order: 2;
}
.reader-no-toc .reader-progress-percent {
display: none;
}
.reader-no-toc {
display: flex;
flex-direction: column;
}
/* Expose summary children to the outer flex ordering when there is no TOC. */
.reader-no-toc .reader-progress-summary {
display: contents;
}
.reader-no-toc .reader-progress-summary strong {
display: none;
}
.reader-no-toc .reader-progress-summary-value {
order: 1;
padding: 4px 0 8px;
text-align: center;
}
.reader-no-toc .reader-progress-bookmark {
order: 3;
align-self: center;
}
.reader-progress-summary[hidden] {
display: none !important;
}
.reader-progress-row input[type="range"] {
min-width: 0;
flex: 1;
accent-color: #8ab4f8;
}
:root[data-theme="light"] .reader-progress-row input[type="range"] {
accent-color: #1769aa;
color-scheme: light;
appearance: auto;
}
.reader-progress-percent {
min-width: 42px;
color: #aeb5ba;
font-size: 12px;
text-align: right;
font-variant-numeric: tabular-nums;
}
.reader-progress-undo,
.reader-chapter-prev,
.reader-chapter-next {
width: 28px;
height: 28px;
display: grid;
place-items: center;
padding: 0;
border: 1px solid transparent;
border-radius: 4px;
background: transparent;
color: #aeb5ba;
cursor: pointer;
}
.reader-progress-undo:hover,
.reader-chapter-prev:hover,
.reader-chapter-next:hover {
border-color: #464c52;
background: #25292d;
color: #e7e9eb;
}
.reader-progress-undo svg,
.reader-chapter-prev svg,
.reader-chapter-next svg {
width: 17px;
height: 17px;
fill: none;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
}
.reader-progress-undo[hidden],
.reader-chapter-prev[hidden],
.reader-chapter-next[hidden] {
display: none;
}
/* Full-text search */
.full-search-input {
width: 110px;
min-width: 0;
height: 28px;
padding: 0 7px;
border: 1px solid #464c52;
border-radius: 4px;
background: #25292d;
color: inherit;
font: inherit;
font-size: 12px;
}
.full-search-input::-webkit-search-cancel-button {
display: none;
}
.full-search-view {
display: flex;
flex-direction: column;
min-height: 0;
}
.full-search-bar {
display: flex;
gap: 6px;
padding: 10px 12px 6px;
}
.full-search-bar .full-search-input {
width: auto;
flex: 1;
height: 34px;
}
.full-search-status {
padding: 0 12px 8px;
color: #929aa1;
font-size: 12px;
}
.full-search-nav {
display: flex;
gap: 6px;
padding: 0 12px 8px;
}
.full-search-nav button,
.full-search-pagination button {
flex: 1;
min-height: 30px;
border: 1px solid #464c52;
border-radius: 4px;
background: transparent;
color: inherit;
cursor: pointer;
}
.full-search-nav button:disabled,
.full-search-pagination button:disabled {
opacity: 0.4;
cursor: default;
}
.full-search-results {
min-height: 0;
overflow: auto;
}
.full-search-pagination:not([hidden]) {
display: flex;
align-items: center;
gap: 6px;
padding: 0 12px 8px;
font-size: 12px;
}
.full-search-pagination label { white-space: nowrap; }
.full-search-pagination input {
width: calc(var(--page-width, 1ch) + 6px);
box-sizing: border-box;
margin: 0;
padding: 2px;
border: 1px solid transparent;
border-radius: 4px;
color: inherit;
background: transparent;
text-align: center;
font: inherit;
font-variant-numeric: tabular-nums;
appearance: textfield;
-moz-appearance: textfield;
}
.full-search-pagination input::-webkit-inner-spin-button,
.full-search-pagination input::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
.full-search-pagination input:focus {
outline: 1px solid var(--reader-focus-color);
background: #22262a;
}
:root[data-theme="light"] .full-search-pagination input:focus {
background: #fff;
}
.full-search-result {
display: grid;
grid-template-columns: max-content minmax(0, 1fr);
column-gap: 4px;
row-gap: 3px;
align-items: baseline;
width: 100%;
padding: 10px 12px;
border: 0;
border-top: 1px solid #2d3237;
background: transparent;
color: inherit;
text-align: left;
cursor: pointer;
}
.full-search-rank {
grid-row: 1;
color: #929aa1;
font-size: 12px;
font-variant-numeric: tabular-nums;
}
.full-search-result:hover,
.full-search-result:focus-visible {
background: #292d31;
outline: none;
}
.full-search-location {
display: block;
min-width: 0;
overflow-wrap: anywhere;
color: #8ab4f8;
font-size: 12px;
}
.full-search-snippet {
grid-column: 1 / -1;
min-width: 0;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 5;
overflow: hidden;
color: #d7dadd;
font-size: 13px;
line-height: 1.55;
overflow-wrap: anywhere;
}
:root[data-theme="light"] .full-search-nav button,
:root[data-theme="light"] .full-search-pagination button {
border-color: #c7ccd0;
}
:root[data-theme="light"] .full-search-result {
border-color: #e0e3e5;
}
:root[data-theme="light"] .full-search-result:hover,
:root[data-theme="light"] .full-search-result:focus-visible {
background: #e7eaed;
}
:root[data-theme="light"] .full-search-snippet {
color: #3f464b;
}
.reader-progress-undo:disabled,
.reader-chapter-prev:disabled,
.reader-chapter-next:disabled {
opacity: 0.35;
cursor: default;
}
/* Panel filtering, lists and TOC */
.panel-view-header {
min-height: 44px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 6px 12px;
}
#history-view .panel-view-header {
justify-content: flex-start;
gap: 8px;
}
#history-view .panel-view-header > strong {
margin-right: auto;
}
.panel-view-header > .text-action {
min-height: 28px;
padding: 0 2px;
line-height: 1;
}
.panel-view-header > span {
display: flex;
align-items: center;
gap: 3px;
}
#history-view .panel-view-header > span .text-action,
#bookmarks-panel .panel-view-header > span .text-action {
min-height: 28px;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 2px;
line-height: 1;
transform: none;
}
.panel-search-toggle {
width: auto;
min-height: 28px;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 2px;
font-size: 12px;
line-height: 1;
transform: translateY(-1px);
}
.panel-search-toggle::after {
content: none;
}
.panel-search {
width: calc(100% - 24px);
height: 34px;
max-height: 0;
margin: 0 12px;
padding: 0 9px;
overflow: hidden;
border: 1px solid #464c52;
border-radius: 4px;
background: #25292d;
color: #e7e9eb;
opacity: 0;
transform: translateY(-6px);
will-change: max-height, margin-bottom, opacity, transform;
transition:
max-height 180ms ease,
margin-bottom 180ms ease,
opacity 140ms ease,
transform 180ms ease,
background-color var(--reader-theme-duration) ease,
color var(--reader-theme-duration) ease,
border-color var(--reader-theme-duration) ease;
}
.panel-search.is-open {
max-height: 34px;
margin-bottom: 8px;
opacity: 1;
transform: translateY(0);
}
.panel-list {
padding-bottom: 12px;
}
.panel-empty {
padding: 28px 12px;
color: #929aa1;
text-align: center;
}
.media-panel-content {
display: grid;
gap: 14px;
padding: 24px 16px;
text-align: center;
}
.media-panel-time {
font-variant-numeric: tabular-nums;
font-size: 24px;
}
.panel-item {
display: grid;
grid-template-columns: minmax(0, 1fr) auto auto;
gap: 4px 8px;
width: 100%;
min-width: 0;
padding: 10px 12px;
border: 0;
border-bottom: 1px solid #2d3237;
background: transparent;
color: inherit;
text-align: left;
}
.panel-item-main {
min-width: 0;
border: 0;
padding: 0;
background: transparent;
color: #e5e9ec;
text-align: left;
cursor: pointer;
overflow-wrap: anywhere;
}
.panel-item > .panel-item-main {
grid-column: 1;
grid-row: 1;
}
.panel-item > .panel-item-edit {
grid-column: 2;
grid-row: 1;
}
.panel-item > .panel-item-remove {
grid-column: 3;
grid-row: 1;
}
.panel-item > small {
grid-column: 1 / -1;
}
.panel-item small {
color: #929aa1;
}
.bookmark-excerpt {
grid-column: 1 / -1;
margin: 2px 0 0;
color: #b8bec3;
font-size: 12px;
line-height: 1.55;
display: -webkit-box;
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
}
.search-match {
padding: 0;
background: #f0c75e;
color: #1d2023;
}
.panel-item-remove,
.text-action,
.panel-item-edit {
border: 0;
background: transparent;
color: #aeb5ba;
cursor: pointer;
}
.toc-item {
padding-left: calc(12px + var(--toc-depth, 0) * 16px);
}
.toc-list-virtualized {
position: relative;
padding-bottom: 12px;
}
.toc-list-virtualized .toc-virtual-row {
position: absolute;
left: 0;
right: 0;
height: 40px;
box-sizing: border-box;
overflow: hidden;
}
.toc-list-virtualized .toc-virtual-row .panel-item-main {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.toc-item .panel-item-main {
user-select: text;
}
.toc-group .panel-item-main {
font-weight: 600;
cursor: default;
}
.toc-current-mark {
color: #8ab4f8;
font-weight: 700;
}
.theme-toggle {
width: 32px;
height: 32px;
flex: none;
padding: 0;
border: 0;
background: transparent;
color: inherit;
display: inline-grid;
place-items: center;
cursor: pointer;
border-radius: 4px;
}
.theme-toggle svg {
width: 19px;
height: 19px;
fill: none;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
}
.theme-toggle.is-changing svg {
animation: reader-theme-icon 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes reader-theme-icon {
from {
opacity: 0;
transform: rotate(-35deg) scale(0.72);
}
to {
opacity: 1;
transform: rotate(0) scale(1);
}
}
#history-close {
width: 32px;
height: 32px;
display: grid;
place-items: center;
padding: 0;
font-family: Arial, sans-serif;
font-size: 22px;
line-height: 1;
transform: translateY(-2px);
}
.reader-viewport {
min-height: 0;
flex: 1;
overflow: auto;
background: #121416;
}
/* Bookmark ribbon and editor */
.bookmark-ribbon {
position: fixed;
z-index: 12;
top: var(--reader-toolbar-height);
left: max(10px, calc((100vw - min(100vw, 1100px)) / 2 + 2px));
width: 28px;
height: 42px;
padding: 0;
border: 0;
background: #b64b50;
box-shadow: 0 2px 8px #0006;
cursor: pointer;
clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%);
}
.bookmark-ribbon:hover,
.bookmark-ribbon:focus-visible {
background: #d35b61;
outline: 2px solid #8ab4f8;
outline-offset: 2px;
}
.bookmark-popover {
position: fixed;
z-index: 22;
top: var(--reader-popover-top);
left: 10px;
width: min(300px, calc(100vw - 20px));
max-height: calc(100vh - var(--reader-popover-top) - 10px);
max-height: calc(100dvh - var(--reader-popover-top) - 10px);
overflow-y: auto;
padding: 12px;
border: 1px solid #464c52;
border-radius: 6px;
background: #25292d;
box-shadow: 0 6px 20px #0009;
}
.bookmark-popover #bookmark-prompt {
display: block;
line-height: 1.5;
}
.bookmark-edit-fields {
display: grid;
gap: 7px;
max-width: 100%;
margin-top: 8px;
}
.bookmark-edit-fields label {
display: grid;
gap: 4px;
min-width: 0;
color: #b8bec3;
font-size: 12px;
}
.bookmark-edit-fields input {
height: 30px;
}
.bookmark-edit-fields input,
.bookmark-edit-fields textarea {
display: block;
width: 100%;
max-width: 100%;
min-width: 0;
padding: 5px 8px;
border: 1px solid #464c52;
border-radius: 4px;
background: #1b1e21;
color: inherit;
font: inherit;
resize: vertical;
}
.bookmark-edit-fields textarea {
min-height: 58px;
}
.bookmark-popover #bookmark-prompt small {
display: -webkit-box;
margin-top: 8px;
overflow: hidden;
color: #b8bec3;
font-size: 12px;
line-height: 1.55;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
}
.bookmark-popover > div {
display: flex;
justify-content: flex-end;
gap: 8px;
margin-top: 12px;
}
/* The editor is a direct div too; keep it out of the action-row flex layout. */
.bookmark-popover > .bookmark-edit-fields {
display: grid;
grid-template-columns: minmax(0, 1fr);
justify-content: stretch;
gap: 7px;
margin: 8px 0 0;
}
.bookmark-popover button {
min-height: 32px;
padding: 0 10px;
border: 1px solid #555c63;
border-radius: 4px;
background: #30353a;
color: inherit;
cursor: pointer;
}
/* Loading and document surfaces */
.loading-status {
display: none !important;
}
.reader-content {
--reader-zoom: 1;
width: min(100%, 1100px);
margin: 0 auto;
padding: 20px;
}
.reader-loading-indicator {
min-height: 220px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 12px;
color: #9ba3aa;
font-size: 13px;
}
.reader-loading-spinner {
width: 24px;
height: 24px;
border: 2px solid #3b4147;
border-top-color: #8ab4f8;
border-radius: 50%;
animation: reader-loading-spin 800ms linear infinite;
}
@keyframes reader-loading-spin {
to {
transform: rotate(360deg);
}
}
.reader-page {
position: relative;
container-type: size;
margin: 0 auto 18px;
background: white;
box-shadow: 0 2px 14px #0008;
min-height: 160px;
}
.reader-pdf-chunk {
display: flow-root;
}
.reader-content[data-mode="pdf"] .reader-page,
.reader-content[data-mode="pdf-pages"] .reader-page {
width: calc(100% * var(--reader-zoom));
}
.reader-content[data-mode="pdf-pages"] .reader-page > img {
display: block;
width: 100%;
max-width: 100%;
height: auto;
user-select: none;
-webkit-user-select: none;
}
.reader-content[data-mode="pdf-pages"] .reader-page {
content-visibility: auto;
contain-intrinsic-size: auto 1px 1414px;
}
.reader-page-state {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
padding: 16px;
color: #6b7280;
font-size: 13px;
text-align: center;
pointer-events: none;
z-index: 2;
}
.reader-page-state[hidden] {
display: none;
}
.reader-page canvas {
display: block;
position: relative;
width: 100%;
height: auto;
user-select: none;
-webkit-user-select: none;
opacity: 0;
transition: opacity 120ms ease;
}
.reader-page canvas.ready {
opacity: 1;
}
.reader-pdf-text {
position: absolute;
inset: 0;
overflow: visible;
pointer-events: none;
white-space: pre;
border: 0;
color: transparent;
z-index: 1;
line-height: 1;
text-size-adjust: none;
-webkit-text-size-adjust: none;
}
.reader-pdf-text-position {
position: absolute;
--reader-pdf-font-ratio: 1;
font-size: calc(var(--reader-pdf-font-ratio) * 100cqw);
transform-origin: left top;
}
.reader-pdf-text-fallback {
position: absolute;
inset: 0;
white-space: pre-wrap;
overflow: hidden;
pointer-events: auto;
}
.reader-pdf-text-run {
display: inline-block;
color: transparent;
white-space: pre;
transform-origin: left top;
user-select: text;
-webkit-user-select: text;
cursor: text;
pointer-events: auto;
}
.reader-pdf-text-run::selection {
color: transparent;
background: #4285f466;
}
.reader-pdf-text-run.full-search-highlight {
color: transparent;
background: #f0c75e88;
}
.reader-pdf-text ::selection,
.reader-pdf-text-run::selection {
color: transparent;
background: #4285f466;
}
.reader-pdf-text mark.full-search-highlight {
color: transparent;
background: #f0c75e88;
}
.reader-image {
display: block;
width: calc(100% * var(--reader-zoom));
max-width: none;
height: auto;
margin: 0 auto;
background: #fff;
}
.reader-chapter-sentinel {
display: block;
width: 100%;
height: 1px;
margin: 0;
padding: 0;
border: 0;
opacity: 0;
overflow: hidden;
pointer-events: none;
}
.reader-content[data-mode="audio"],
.reader-content[data-mode="video"] {
width: 100%;
height: 100%;
padding: 0;
display: grid;
place-items: center;
}
.reader-audio {
display: block;
width: min(720px, calc(100% - 32px));
}
.reader-video {
display: block;
width: 100%;
height: 100%;
max-height: calc(100vh - var(--reader-toolbar-height));
max-height: calc(100dvh - var(--reader-toolbar-height));
object-fit: contain;
background: #000;
}
.reader-text {
margin: 0 auto;
max-width: 76ch;
white-space: pre-wrap;
overflow-wrap: anywhere;
font:
calc(17px * var(--reader-zoom)) / 1.8 ui-monospace,
monospace;
color: #e7e9eb;
}
.reader-markdown {
margin: 0 auto;
max-width: 76ch;
font-size: calc(17px * var(--reader-zoom));
line-height: 1.75;
}
.reader-markdown img {
max-width: 100%;
}
.reader-markdown a {
color: #72a7df;
}
.reader-error {
margin: 20vh auto;
max-width: 560px;
color: #d7dadd;
text-align: center;
line-height: 1.6;
}
/* Chapter bundles and Foliate hosts. Chapter Shadow DOM has its own stylesheet. */
.epub-frame {
width: 100%;
height: auto;
min-height: 100%;
background: #181b1e;
}
.foliate-reader-view {
display: block;
width: 100%;
height: 100%;
min-height: 100%;
background: #181b1e;
}
.foliate-continuous {
--reader-book-link: #8ab4e8;
width: min(100%, 900px);
min-height: 100%;
margin: 0 auto;
padding: 24px 20px 64px;
background: #181b1e;
color: #e7e9eb;
}
.foliate-continuous > article {
min-height: 0 !important;
height: auto !important;
margin: 0 auto 32px;
padding-top: 0 !important;
line-height: 1.7;
break-before: auto !important;
page-break-before: auto !important;
font-size: calc(1em * var(--reader-zoom));
}
/* Virtualized chapters must reserve their measured height. */
.foliate-continuous > article.foliate-section-placeholder {
height: var(--foliate-placeholder-height) !important;
min-height: var(--foliate-placeholder-height) !important;
padding: 0 !important;
contain: strict;
pointer-events: none;
}
.foliate-continuous > article > :first-child {
margin-top: 0 !important;
}
.foliate-continuous a {
color: #8ab4e8 !important;
}
.foliate-continuous a[href]:not([href^="http:"]):not([href^="https:"]) {
text-decoration: none !important;
}
.foliate-continuous :is(p, div, span, li, td, th, blockquote, pre, code, h1, h2, h3, h4, h5, h6) {
color: inherit !important;
}
.foliate-continuous img,
.foliate-continuous svg,
.foliate-continuous video {
max-width: 100%;
height: auto;
}
:root[data-theme="light"] .foliate-continuous {
--reader-book-link: #185abc;
background: #fff;
color: #202124;
}
:root[data-theme="light"] .foliate-continuous a {
color: #185abc !important;
}
.reader-content[data-mode="foliate"] {
width: 100%;
height: calc(100vh - var(--reader-toolbar-height));
height: calc(100dvh - var(--reader-toolbar-height));
min-height: calc(100vh - var(--reader-toolbar-height));
min-height: calc(100dvh - var(--reader-toolbar-height));
padding: 0;
}
.reader-content[data-mode="foliate"] > .foliate-reader-view {
width: 100%;
height: 100%;
min-height: 320px;
}
/* Isolated HTML and vendor-generated DOCX */
.html-frame {
display: block;
width: 100%;
height: calc(100vh - 96px);
border: 0;
background: white;
color-scheme: only light;
}
.html-frame.spreadsheet-html-frame {
overflow: auto;
}
.reader-content--spreadsheet {
width: 100%;
max-width: none;
padding: 0;
}
.docx-body {
overflow-x: auto;
color: #e7e9eb;
}
.docx-body .reader-docx-wrapper {
background: transparent;
padding: 0;
zoom: var(--reader-zoom);
width: 100%;
max-width: none;
align-items: stretch;
}
.docx-body .reader-docx-wrapper > section.reader-docx {
width: 100% !important;
max-width: none;
box-sizing: border-box;
padding-left: clamp(16px, 5vw, 2cm) !important;
padding-right: clamp(16px, 5vw, 2cm) !important;
margin: 0 auto 18px;
box-shadow: 0 2px 14px #0008;
}
.docx-body.reader-document-dark .reader-docx {
background: #181b1e !important;
color: #e7e9eb !important;
}
.docx-body.reader-document-dark .reader-docx :where(:not(svg, svg *, img, canvas, video, audio, math, math *)),
:root[data-theme="dark"] .reader-epub-chapter :where(:not(svg, svg *, img, canvas, video, audio, math, math *)) {
color: inherit !important;
background-color: transparent !important;
border-color: #4a5056 !important;
text-shadow: none !important;
}
.docx-body.reader-document-dark .reader-docx :is(table, pre, code, blockquote) {
background-color: #202428 !important;
}
.docx-body.reader-document-dark .reader-docx a,
:root[data-theme="dark"] .reader-epub-chapter a {
color: #8ab4e8 !important;
}
:root[data-theme="dark"] .reader-epub-chapter mark.full-search-highlight,
.docx-body.reader-document-dark .reader-docx mark.full-search-highlight {
background: #ffd54f !important;
color: #111 !important;
}
/* Light theme: retain the dark palette above and override matching surfaces. */
:root[data-theme="light"] {
--reader-focus-color: #1769aa;
color-scheme: light;
background: #f4f5f6;
color: #202124;
}
:root[data-theme="light"] .reader-toolbar,
:root[data-theme="light"] .reader-panel {
background: #fff;
border-color: #d7dadd;
}
:root[data-theme="light"] .reader-viewport {
background: #e9ecef;
}
:root[data-theme="light"] .reader-panel-tabs,
:root[data-theme="light"] .reader-panel > header,
:root[data-theme="light"] .reader-panel > footer {
border-color: #d7dadd;
}
:root[data-theme="light"] .reader-panel-tabs button,
:root[data-theme="light"] .panel-item small {
color: #5f666c;
}
:root[data-theme="light"] .reader-progress-tools {
border-color: #d7dadd;
}
:root[data-theme="light"] .reader-panel-tabs button[aria-selected="true"],
:root[data-theme="light"] .panel-item-main {
color: #202124;
}
:root[data-theme="light"] .panel-item {
border-color: #e0e3e5;
}
:root[data-theme="light"] .bookmark-excerpt {
color: #535a60;
}
:root[data-theme="light"] .bookmark-popover #bookmark-prompt small {
color: #535a60;
}
:root[data-theme="light"] .bookmark-edit-fields label {
color: #535a60;
}
:root[data-theme="light"] .bookmark-edit-fields input,
:root[data-theme="light"] .bookmark-edit-fields textarea {
background: #f3f5f6;
border-color: #c7ccd0;
color: #202124;
}
:root[data-theme="light"] .panel-search,
:root[data-theme="light"] .theme-toggle,
:root[data-theme="light"] .bookmark-popover {
background: #fff;
border-color: #c7ccd0;
color: #202124;
}
:root[data-theme="light"] .compact-input {
background: #f3f5f6;
border-color: #c7ccd0;
color: #202124;
}
:root[data-theme="light"] .icon-button:hover,
:root[data-theme="light"] .text-button:hover {
background: #e7eaed;
}
:root[data-theme="light"] .icon-button:active,
:root[data-theme="light"] .text-button:active {
background: #dce1e5;
}
:root[data-theme="light"] .bookmark-popover button {
background: #f3f5f6;
border-color: #c7ccd0;
color: #202124;
}
:root[data-theme="light"] .reader-text,
:root[data-theme="light"] .reader-markdown,
:root[data-theme="light"] .docx-body {
color: #202124;
}
:root[data-theme="light"] .docx-body .reader-docx {
background: #fff !important;
color: #202124 !important;
}
:root[data-theme="light"] .full-search-input {
background: #f3f5f6;
border-color: #c7ccd0;
color: #202124;
}
:root[data-theme="light"] .reader-error {
color: #3f464b;
}
:root[data-theme="light"] .epub-frame {
background: #fff;
}
:root[data-theme="light"]
:is(
.reader-heading span,
.reader-path,
.text-action,
.panel-item-edit,
.panel-item-remove,
.reader-progress-percent,
.reader-progress-undo,
.reader-chapter-prev,
.reader-chapter-next,
.full-search-status,
.panel-empty,
.reader-loading-indicator
) {
color: #5f666c;
}
:root[data-theme="light"] .reader-path:hover,
:root[data-theme="light"] .reader-path:focus-visible {
color: #202124;
}
:root[data-theme="light"]
:is(.full-search-location, .reader-progress-summary-value, .toc-current-mark),
:root[data-theme="light"] .reader-markdown a {
color: #185abc;
}
:root[data-theme="light"]
:is(.reader-progress-undo, .reader-chapter-prev, .reader-chapter-next):hover {
border-color: #c7ccd0;
background: #e7eaed;
color: #202124;
}
/* Compose theme colors with drawer/filter motion instead of replacing it. */
:root.theme-transition {
--reader-theme-duration: 260ms;
}
:root.theme-transition,
:root.theme-transition body,
:root.theme-transition .reader-toolbar,
:root.theme-transition .reader-viewport,
:root.theme-transition .compact-input,
:root.theme-transition .bookmark-popover,
:root.theme-transition .bookmark-popover button,
:root.theme-transition .reader-text,
:root.theme-transition .reader-markdown,
:root.theme-transition .docx-body,
:root.theme-transition .docx-body .reader-docx {
transition:
background-color 260ms ease,
color 260ms ease,
border-color 260ms ease;
}
/* Keyboard focus and accessibility preferences */
:is(.reader-toolbar, .reader-panel, .bookmark-popover)
:is(button, a, input, textarea, [tabindex]):focus-visible {
outline: 2px solid var(--reader-focus-color);
outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
.reader-panel,
.panel-search,
.reader-page canvas,
:root.theme-transition,
:root.theme-transition *,
.theme-toggle.is-changing svg {
transition-duration: 0s !important;
transition-delay: 0s !important;
animation-duration: 0s !important;
}
.reader-loading-spinner {
animation: none;
border-top-color: #3b4147;
}
}
@media (prefers-contrast: more) {
/* Match theme specificity, including the initial root without data-theme. */
:is(:root, :root[data-theme])
:is(
.reader-toolbar,
.reader-panel,
.reader-panel-tabs,
.reader-panel > header,
.reader-page,
.reader-progress-tools
) {
border-color: currentColor;
}
:is(.reader-toolbar, .reader-panel, .bookmark-popover)
:is(button, a, input, textarea, [tabindex]):focus-visible,
.reader-page:focus-visible {
outline: 3px solid currentColor;
outline-offset: 2px;
}
/* Shadow-root chapter links need this preference in their JS-owned stylesheet. */
.reader-content a,
.foliate-continuous a,
.foliate-continuous a[href]:not([href^="http:"]):not([href^="https:"]) {
text-decoration: underline !important;
}
.reader-pdf-text span.full-search-highlight,
.search-match {
outline: 2px solid currentColor;
}
}
/* Mobile toolbar and bookmark placement */
@media (max-width: 600px) {
:root {
--reader-toolbar-height: 36px;
--reader-popover-top: 78px;
}
.panel-search-toggle {
min-width: 42px;
}
.reader-toolbar {
gap: 1px;
padding: 2px 5px;
}
.reader-content {
padding: 10px;
}
.reader-text,
.reader-markdown {
width: 100%;
max-width: none;
overflow-wrap: anywhere;
}
.foliate-continuous {
padding: 16px 12px 48px;
}
.foliate-continuous > article {
overflow-wrap: anywhere;
}
.docx-body,
.docx-body .reader-docx-wrapper {
min-width: 0;
max-width: 100%;
box-sizing: border-box;
}
.docx-body .reader-docx-wrapper > section.reader-docx {
width: 100% !important;
max-width: none;
min-width: 0;
overflow-wrap: anywhere;
}
.docx-body .reader-docx-wrapper img,
.docx-body .reader-docx-wrapper svg,
.docx-body .reader-docx-wrapper video {
max-width: 100%;
height: auto;
}
.html-frame {
height: calc(100dvh - var(--reader-toolbar-height));
}
.reader-video {
max-width: 100%;
}
.reader-heading {
display: none;
}
.reader-actions {
flex: 1;
justify-content: flex-end;
gap: 1px;
min-width: 0;
}
.reader-actions .control-group {
gap: 0;
}
.reader-actions .text-button {
height: 30px;
padding: 0 3px;
}
.loading-status {
padding: 10px 6px 0;
}
.icon-button {
width: 26px;
height: 30px;
flex: none;
}
.compact-input {
height: 30px;
padding-right: 3px;
font-size: 11px;
}
.compact-input input {
width: 24px;
height: 28px;
}
.zoom-controls .compact-input input {
width: 32px;
}
.bookmark-ribbon {
left: 4px;
width: 24px;
height: 36px;
}
}