diff --git a/src/lib/components/edra/editor.css b/src/lib/components/edra/editor.css index 175c4f0..ba42f1f 100644 --- a/src/lib/components/edra/editor.css +++ b/src/lib/components/edra/editor.css @@ -7,6 +7,17 @@ margin-top: 0; } +/* Paragraph spacing */ +.tiptap p { + margin-top: 0; + margin-bottom: 1rem; + line-height: 1.6; +} + +.tiptap p:last-child { + margin-bottom: 0; +} + /* For Placeholder */ .tiptap .is-empty::before { pointer-events: none; @@ -24,16 +35,27 @@ .tiptap h5, .tiptap h6 { line-height: 1.2; - margin-top: 1rem; + margin-top: 1.5rem; + margin-bottom: 0.75rem; text-wrap: pretty; } .tiptap h1, .tiptap h2 { - margin-top: 1rem; + margin-top: 2rem; margin-bottom: 1rem; } +/* Reduce top margin for headings that immediately follow other elements */ +.tiptap p + h1, +.tiptap p + h2, +.tiptap p + h3, +.tiptap p + h4, +.tiptap p + h5, +.tiptap p + h6 { + margin-top: 1.5rem; +} + .tiptap h1 { font-size: 2rem; } @@ -66,6 +88,10 @@ margin: 0; } +.tiptap blockquote p:not(:last-child) { + margin-bottom: 0.5rem; +} + /* Horizontal Rule */ .tiptap hr { border: none; @@ -85,10 +111,27 @@ /* List Styling */ +.tiptap ul, +.tiptap ol { + margin-top: 0; + margin-bottom: 1rem; + padding-left: 1.5rem; +} + +.tiptap ul li, +.tiptap ol li { + margin-bottom: 0.25rem; +} + .tiptap ul li p, .tiptap ol li p { - margin-top: 0.25em; - margin-bottom: 0.25em; + margin-top: 0; + margin-bottom: 0.25rem; +} + +.tiptap ul li:last-child, +.tiptap ol li:last-child { + margin-bottom: 0; } /* Task List Styling */ @@ -431,6 +474,8 @@ input[type='checkbox'] { padding: 1.5rem; position: relative; height: fit-content; + margin-top: 0; + margin-bottom: 1rem; } .code-wrapper-tile {