From 428716e47985be2d8df18213b0a3b7871029e10a Mon Sep 17 00:00:00 2001 From: Bendik Aagaard Lynghaug Date: Fri, 14 Aug 2026 19:45:58 +0200 Subject: [PATCH] Editor type in rem: prosekit's px typography ignored the responsive root Co-Authored-By: Claude Fable 5 --- style/main.css | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/style/main.css b/style/main.css index c898c1e..2e9bf10 100644 --- a/style/main.css +++ b/style/main.css @@ -494,14 +494,60 @@ textarea:focus { box-shadow: 0 0 0 3px var(--accent-soft); } -.prosekit-editor p { +/* ProseKit's typography.css (loaded from esm.sh at mount time) sets + fixed px font sizes on .ProseMirror, so they ignore the responsive + root font-size. Re-state them in rem/em at the same proportions, + with .prosekit-editor prefixed so these win on specificity. */ +.prosekit-editor .ProseMirror p { + font-size: 1rem; + line-height: 1.5; margin: 0 0 0.6em; } -.prosekit-editor p:last-child { +.prosekit-editor .ProseMirror p:last-child { margin-bottom: 0; } +.prosekit-editor .ProseMirror h1 { + font-size: 2.5rem; + line-height: 1.1; + margin: 0.9em 0 0.1em; +} + +.prosekit-editor .ProseMirror h2 { + font-size: 1.875rem; + line-height: 1.3; + margin: 1.05em 0 0.13em; +} + +.prosekit-editor .ProseMirror h3 { + font-size: 1.5rem; + line-height: 1.33; + margin: 0.9em 0 0.04em; +} + +.prosekit-editor .ProseMirror h4 { + font-size: 1.25rem; + line-height: 1.3; + margin: 0.8em 0 0.05em; +} + +.prosekit-editor .ProseMirror h5 { + font-size: 1.125rem; + line-height: 1.22; + margin: 0.78em 0 0.06em; +} + +.prosekit-editor .ProseMirror h6 { + font-size: 1rem; + line-height: 1.25; + margin: 0.75em 0 0.06em; +} + +.prosekit-editor .ProseMirror :is(h1, h2, h3, h4, h5, h6):first-child { + margin-top: 0; +} + .alt-submit { font-family: var(--sans); font-weight: 600;