feat: set fixed A4 paper size for the editor canvas

This commit is contained in:
Steffen Becker committed 2026-05-25 20:43:04 +02:00
1 parent 11b51efaa2
commit c3da447674
2 files changed
+20 -15

No files matched your search

+1 -1
View File
@@ -32,5 +32,5 @@
</script>
<div class="editor">
<div bind:this={element}></div>
<div bind:this={element} class="paper"></div>
</div>
+19 -14
View File
@@ -6,14 +6,19 @@
overflow-y: auto;
}
.editor .tiptap {
/* Fixed A4 paper container (794px = 210mm at 96dpi) */
.paper {
width: 794px;
max-width: calc(100vw - 2rem);
flex-shrink: 0;
}
.paper .tiptap {
width: 100%;
max-width: 720px;
min-height: 60vh;
padding: 2rem;
min-height: 1123px; /* 297mm at 96dpi */
padding: 2.5rem 3rem;
background: var(--color-surface);
border-radius: var(--radius);
box-shadow: var(--shadow);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
border: 1px solid var(--color-border);
outline: none;
font-family: var(--font-serif);
@@ -22,13 +27,13 @@
color: var(--color-text);
}
.editor .tiptap p {
.paper .tiptap p {
margin-bottom: 0.75em;
}
.editor .tiptap h1,
.editor .tiptap h2,
.editor .tiptap h3 {
.paper .tiptap h1,
.paper .tiptap h2,
.paper .tiptap h3 {
font-family: var(--font-sans);
font-weight: 700;
line-height: 1.3;
@@ -36,19 +41,19 @@
margin-bottom: 0.5em;
}
.editor .tiptap h1 {
.paper .tiptap h1 {
font-size: 1.75rem;
}
.editor .tiptap h2 {
.paper .tiptap h2 {
font-size: 1.4rem;
}
.editor .tiptap h3 {
.paper .tiptap h3 {
font-size: 1.15rem;
}
.editor .tiptap p.is-editor-empty:first-child::before {
.paper .tiptap p.is-editor-empty:first-child::before {
content: attr(data-placeholder);
float: left;
color: var(--color-text-muted);