Skip to content

Commit d1d78d2

Browse files
authored
refactor: update RTE content styles, improve nested lists indentation (#10309)
1 parent d93a06b commit d1d78d2

32 files changed

+13
-4
lines changed

packages/rich-text-editor/src/styles/vaadin-rich-text-editor-base-styles.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const base = css`
4242
max-height: inherit;
4343
min-height: inherit;
4444
border-radius: inherit;
45+
contain: paint;
4546
}
4647
4748
.vaadin-rich-text-editor-container:has([part='content']:focus-within),
@@ -52,9 +53,9 @@ const base = css`
5253

5354
export const content = css`
5455
:host {
55-
--_item-indent: var(--vaadin-padding-l);
56-
--_marker-indent: calc(var(--vaadin-padding-s) / 2);
57-
--_list-indent: calc(var(--_item-indent) + var(--_marker-indent));
56+
--_item-indent: var(--vaadin-padding-s);
57+
--_marker-indent: var(--vaadin-gap-s);
58+
--_list-indent: var(--_item-indent);
5859
}
5960
6061
[part='content'] {
@@ -373,6 +374,14 @@ export const content = css`
373374
max-width: 100%;
374375
}
375376
377+
.ql-editor > :is(p, ol, ul, blockquote, .ql-code-block-container):first-child {
378+
margin-top: 0;
379+
}
380+
381+
.ql-editor > :is(p, ol, ul, blockquote, .ql-code-block-container):last-child {
382+
margin-bottom: 0;
383+
}
384+
376385
/* RTL specific styles */
377386
:host([dir='rtl']) .ql-editor {
378387
direction: rtl;
-270 Bytes
Loading
72 Bytes
Loading
-164 Bytes
Loading
-64 Bytes
Loading
-201 Bytes
Loading
-119 Bytes
Loading
-107 Bytes
Loading
389 Bytes
Loading
115 Bytes
Loading

0 commit comments

Comments
 (0)