From d9b0fe2aaa50387858fd264d2ac7fa1f402e0957 Mon Sep 17 00:00:00 2001 From: "M. Palanikannan" <73993394+Palanikannan1437@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:03:16 +0530 Subject: [PATCH] fix: placeholder for list items (#5389) --- packages/editor/src/styles/editor.css | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/editor/src/styles/editor.css b/packages/editor/src/styles/editor.css index 2ec35dc25..1117b7c5c 100644 --- a/packages/editor/src/styles/editor.css +++ b/packages/editor/src/styles/editor.css @@ -79,6 +79,7 @@ -moz-appearance: textfield; } +/* Placeholder only for the first line in an empty editor. */ .ProseMirror p.is-editor-empty:first-child::before { content: attr(data-placeholder); float: left; @@ -87,6 +88,15 @@ height: 0; } +/* Display Placeholders on every new line. */ +.ProseMirror p.is-empty::before { + content: attr(data-placeholder); + float: left; + color: rgb(var(--color-text-400)); + pointer-events: none; + height: 0; +} + .ProseMirror li blockquote { margin-top: 10px; padding-inline-start: 1em; @@ -110,14 +120,6 @@ display: none; } -.ProseMirror .is-empty::before { - content: attr(data-placeholder); - float: left; - color: rgb(var(--color-text-400)); - pointer-events: none; - height: 0; -} - /* Custom image styles */ .ProseMirror img { transition: filter 0.1s ease-in-out;