Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
203 changes: 201 additions & 2 deletions src/viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,197 @@ body {
justify-content: center;
}

.outline-toggle {
position: fixed;
top: 14px;
right: 50px;
width: 32px;
height: 32px;
border: 1px solid var(--border);
border-radius: 50%;
background: var(--bg);
color: var(--muted-text);
font-size: 16px;
line-height: 1;
cursor: pointer;
opacity: 0;
transition: opacity 0.2s;
z-index: 1000;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
}

.outline-panel {
position: fixed;
box-sizing: border-box;
top: 56px;
right: 14px;
width: 300px;
max-height: calc(100vh - 80px);
overflow: hidden;
overscroll-behavior: contain;
display: none;
flex-direction: column;
padding: 14px 14px 16px;
border: 1px solid var(--border);
border-radius: 14px;
background: var(--find-panel-bg);
box-shadow: var(--find-panel-shadow);
backdrop-filter: blur(18px);
z-index: 1050;
}

.outline-panel--visible {
display: flex;
}

.outline-panel__header {
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 10px;
margin-bottom: 6px;
border-bottom: 1px solid var(--border);
}

.outline-panel__content {
min-height: 0;
overflow-y: auto;
margin-right: -14px;
padding-top: 4px;
padding-right: 14px;
}

.outline-panel__header-left {
display: flex;
align-items: baseline;
gap: 8px;
}

.outline-panel__title {
margin: 0;
font: 600 17px/1.2 "SF Pro Display", "Segoe UI", sans-serif;
color: var(--heading-text);
letter-spacing: -0.01em;
}

.outline-panel__pin-btn {
border: none;
background: none;
color: var(--muted-text);
font: 400 11px/1 "SF Pro Text", "Segoe UI", sans-serif;
cursor: pointer;
padding: 2px 5px;
border-radius: 4px;
letter-spacing: 0.02em;
}

.outline-panel__pin-btn:hover {
color: var(--page-text);
background: var(--inline-code-bg);
}

.outline-panel__pin-btn--active {
color: var(--accent);
font-weight: 600;
}

.outline-panel__expand-btn {
border: none;
background: none;
color: var(--muted-text);
font: 400 11px/1.2 "SF Pro Text", "Segoe UI", sans-serif;
cursor: pointer;
padding: 3px 6px;
border-radius: 4px;
white-space: nowrap;
}

.outline-panel__expand-btn:hover {
color: var(--accent);
background: var(--inline-code-bg);
}

.outline-panel__list {
list-style: none;
margin: 0;
padding: 0;
}

.outline-panel__list .outline-panel__list {
padding-left: 16px;
}

.outline-panel__item {
margin: 0 0 3px;
}

.outline-panel__row {
display: flex;
align-items: flex-start;
border-radius: 5px;
padding: 3px 4px;
transition: background 0.1s;
}

.outline-panel__row:hover {
background: var(--inline-code-bg);
}

.outline-panel__toggle {
flex-shrink: 0;
width: 18px;
border: none;
background: none;
color: var(--muted-text);
font-size: 12px;
cursor: pointer;
padding: 0;
line-height: 1.7;
text-align: center;
align-self: flex-start;
}

.outline-panel__spacer {
flex-shrink: 0;
width: 18px;
}

.outline-panel__link {
flex: 1;
min-width: 0;
border: none;
background: none;
color: var(--page-text);
font: 400 14px/1.65 "SF Pro Text", "Segoe UI", sans-serif;
text-align: left;
cursor: pointer;
padding: 1px 4px;
white-space: normal;
word-break: break-word;
text-decoration: none;
}

.outline-panel__row:hover .outline-panel__link {
color: var(--accent);
text-decoration: underline;
text-underline-offset: 2px;
}

.outline-panel__children--collapsed {
display: none;
}

.outline-panel__empty {
color: var(--muted-text);
font: 400 12px/1.5 "SF Pro Text", "Segoe UI", sans-serif;
padding: 4px;
margin: 0;
}

.find-panel {
position: fixed;
top: 14px;
Expand Down Expand Up @@ -358,11 +549,13 @@ body {
color: var(--find-active-text);
}

body:hover .theme-toggle {
body:hover .theme-toggle,
body:hover .outline-toggle {
opacity: 0.5;
}

.theme-toggle:hover {
.theme-toggle:hover,
.outline-toggle:hover {
opacity: 1 !important;
color: var(--page-text);
}
Expand All @@ -382,6 +575,10 @@ body:hover .theme-toggle {
width: 100%;
min-width: 0;
}

.outline-panel {
width: 300px;
}
}

@media print {
Expand All @@ -391,6 +588,8 @@ body:hover .theme-toggle {
}

.theme-toggle,
.outline-toggle,
.outline-panel,
.find-panel {
display: none;
}
Expand Down
Loading