From acfff03e32a1a799bd8e4a72e0403efe43c1f559 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 13 May 2026 21:40:49 -0400 Subject: [PATCH] Hide drag handle when printing, adjust heading actions for handle gutter Co-Authored-By: Claude Opus 4.7 --- shared/editor/components/Styles.ts | 6 ++++-- shared/styles/globals.ts | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/shared/editor/components/Styles.ts b/shared/editor/components/Styles.ts index 7813627762..9234cfcfec 100644 --- a/shared/editor/components/Styles.ts +++ b/shared/editor/components/Styles.ts @@ -1215,7 +1215,9 @@ h6:not(.placeholder):not([data-heading-prefix])::before { left: 0; top: 0; bottom: 0; - margin-left: -26px; + /* Offset further left than the default so the anchor clears the block + drag handle, which occupies the gutter immediately left of the heading. */ + margin-left: -52px; width: 26px; align-items: center; justify-content: center; @@ -1239,7 +1241,7 @@ h6:not(.placeholder):not([data-heading-prefix])::before { &:dir(rtl) { margin-left: 0; - margin-right: -26px; + margin-right: -52px; } } diff --git a/shared/styles/globals.ts b/shared/styles/globals.ts index 3748542d28..58cc6c6abf 100644 --- a/shared/styles/globals.ts +++ b/shared/styles/globals.ts @@ -174,4 +174,12 @@ export default createGlobalStyle` .drop-cursor { border-radius: 9999px; } + + /* Block drag handle is appended to document.body, outside the styled + EditorContainer scope, so the print rule has to live globally. */ + @media print { + .block-drag-handle { + display: none !important; + } + } `;