fix: a section keeps its own side margins too

.tiptap's padding draws one pair of side margins for the whole document, so a
title page declaring 3.18cm left sat 3.85mm off. The difference now rides a
--sec-inset-left/-right node decoration on the section's top-level blocks, and
everything that writes a block margin adds it in — an indent, a named style's
and a table's alignment all compose with it instead of losing to it.
This commit is contained in:
Steffen Becker committed 2026-08-11 19:03:58 +00:00
1 parent 9bce48f6e0
commit baf0865256
7 files changed
+87 -8

No files matched your search

+13
View File
@@ -153,6 +153,19 @@
font-size: 0;
}
/* A section whose page setup has side margins of its own insets its top-level blocks by
the difference — .tiptap's padding can only draw one pair (pageBreaks.ts sets the two
properties per block). Everything that writes a block margin adds them in, so an indent
and the inset compose; a descendant clears them, or a nested one would add them twice. */
.paper .tiptap > * {
margin-left: var(--sec-inset-left, 0px);
margin-right: var(--sec-inset-right, 0px);
}
.paper .tiptap > * * {
--sec-inset-left: 0px;
--sec-inset-right: 0px;
}
/* No paragraph spacing by default, like LibreOffice's Default Paragraph Style and
Word's implied 0 — an editor default here would show up as extra space in every
imported document (export/odt.ts zeroes odf-kit's Standard style to match). */