Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,25 @@
max-width: 100%;
min-width: 0;
overflow-x: auto;
/* Own block-level spacing (replaces the inner <pre> margins which are
now zeroed out below). */
margin-top: 1.5em;
margin-bottom: 1.5em;
}

/* When a heading precedes a code block, remove the top margin so only
the heading's own margin-bottom creates the gap. */
.page-viewer__content :where(h1, h2, h3, h4, h5, h6) + .markdown-code-block,
.markdown-editor__preview :where(h1, h2, h3, h4, h5, h6) + .markdown-code-block,
.page-history__preview-body :where(h1, h2, h3, h4, h5, h6) + .markdown-code-block {
margin-top: 0;
}

.page-viewer__content .markdown-code-block pre,
.markdown-editor__preview .markdown-code-block pre,
.page-history__preview-body .markdown-code-block pre {
margin-top: 0;
margin-bottom: 0;
}

.page-viewer__content .markdown-code-block__actions,
Expand Down
58 changes: 57 additions & 1 deletion ui/leafwiki-ui/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,7 @@
}

.page-viewer {
@apply mx-auto flex min-h-full w-full max-w-4xl flex-col px-8 pt-3 pb-0;
@apply mx-auto flex min-h-full w-full max-w-5xl flex-col px-8 pt-3 pb-0;
}

.page-viewer__subheader {
Expand Down Expand Up @@ -1573,6 +1573,62 @@
@apply prose prose-base text-page-text dark:prose-invert mt-6 max-w-full flex-1 leading-relaxed;
}

.page-viewer__content :where(h1),
.markdown-editor__preview :where(h1),
.page-history__preview-body :where(h1) {
@apply mt-10 mb-3;
}

.page-viewer__content :where(h2),
.markdown-editor__preview :where(h2),
.page-history__preview-body :where(h2) {
@apply mt-10 mb-3;
}

.page-viewer__content :where(h3),
.markdown-editor__preview :where(h3),
.page-history__preview-body :where(h3) {
@apply mt-8 mb-2;
}

.page-viewer__content :where(h4, h5, h6),
.markdown-editor__preview :where(h4, h5, h6),
.page-history__preview-body :where(h4, h5, h6) {
@apply mt-6 mb-2;
}

.page-viewer__content :where(h1, h2, h3, h4, h5, h6):first-child,
.markdown-editor__preview :where(h1, h2, h3, h4, h5, h6):first-child,
.page-history__preview-body :where(h1, h2, h3, h4, h5, h6):first-child {
@apply mt-2;
}

/* Heading directly after heading — tighter spacing */
.page-viewer__content :where(h1 + h2, h2 + h3, h3 + h4, h4 + h5, h5 + h6),
.markdown-editor__preview :where(h1 + h2, h2 + h3, h3 + h4, h4 + h5, h5 + h6),
.page-history__preview-body
:where(h1 + h2, h2 + h3, h3 + h4, h4 + h5, h5 + h6) {
@apply mt-4;
}

.page-viewer__content :where(p),
.markdown-editor__preview :where(p),
.page-history__preview-body :where(p) {
@apply my-3;
}

.page-viewer__content :where(ul, ol),
.markdown-editor__preview :where(ul, ol),
.page-history__preview-body :where(ul, ol) {
@apply my-3;
}

.page-viewer__content :where(li),
.markdown-editor__preview :where(li),
.page-history__preview-body :where(li) {
@apply my-1;
}

.page-viewer__metadata {
@apply text-muted-foreground flex flex-wrap items-center text-[11px] leading-4 opacity-80;
}
Expand Down
Loading