document viewer

This commit is contained in:
2025-11-12 02:24:46 +01:00
parent 762e4ee315
commit 44c982f015
7 changed files with 546 additions and 192 deletions
+40 -15
View File
@@ -43,7 +43,7 @@
display: flex;
flex-direction: column;
gap: 0.5rem;
padding: 0.5rem 1rem 1rem;
padding: 0.5rem 1rem 0.5rem;
overflow: auto;
}
@@ -53,7 +53,8 @@
flex-direction: column;
justify-content: center;
align-items: center;
max-height: calc(var(--document-viewer-portrait-height-ratio) * 100vh);
flex: 1;
min-height: 0;
order: -1;
}
@@ -189,6 +190,15 @@
min-height: 0;
}
.document-viewer__tabs-wrapper--bottom .document-viewer__tabpanes {
order: 1;
}
.document-viewer__tabs-wrapper--bottom .document-viewer__tabs {
order: 2;
margin-top: 0.75rem;
}
.document-viewer__section {
display: flex;
flex-direction: column;
@@ -268,28 +278,37 @@
font-size: 0.85rem;
line-height: 1.35;
overflow: auto;
word-break: break-word;
overflow-wrap: anywhere;
white-space: pre-wrap;
}
.document-viewer__tabs {
display: inline-flex;
align-items: center;
gap: 0.5rem;
border-bottom: 1px solid var(--outline-subtle);
display: flex;
align-items: stretch;
gap: 0.25rem;
padding: 0.25rem;
border-radius: 999px;
background: var(--surface-overlay, var(--surface));
border: 1px solid var(--outline-subtle);
box-shadow: var(--panel-shadow-soft, none);
}
.document-viewer__tab {
appearance: none;
border: none;
background: transparent;
padding: 0.4rem 0.75rem;
padding: 0.35rem 0.9rem;
font-size: 0.85rem;
font-weight: 500;
color: var(--muted);
cursor: pointer;
border-bottom: 2px solid transparent;
transition:
color 120ms ease,
border-color 120ms ease;
background-color 120ms ease;
border-radius: 999px;
flex: 1;
text-align: center;
}
.document-viewer__tab:hover,
@@ -298,8 +317,8 @@
}
.document-viewer__tab.is-active {
color: var(--accent);
border-color: var(--accent);
color: var(--accent-strong, var(--accent));
background: var(--accent-soft);
}
.document-viewer__tabpanes {
@@ -308,6 +327,10 @@
display: flex;
}
.document-viewer--stacked .document-viewer__tabpanes {
overflow: auto;
}
.document-viewer__tabpanes--single {
flex: 1;
min-height: 0;
@@ -345,7 +368,7 @@
display: flex;
position: relative;
overflow: hidden;
align-items: flex-start;
align-items: stretch;
justify-content: flex-start;
max-height: 100%;
grid-area: viewport;
@@ -369,12 +392,11 @@
}
.document-viewer--stacked .document-viewer__object:not(.document-viewer__object--image) {
height: calc(var(--document-viewer-portrait-height-ratio) * 100vh);
max-height: 100%;
height: 100%;
}
.document-viewer--stacked .document-viewer__object--image {
height: auto;
max-height: 100%;
}
.document-viewer__unsupported {
@@ -408,3 +430,6 @@
width: 1rem;
height: 1rem;
}
.document-viewer__summary-tab-content {
padding-top: 0.5rem;
}