Skip to content

Commit f2397a8

Browse files
authored
style(richtext-lexical): lists and quotes have inconsistent letter spacing (#15682)
This fixes an issue where letter spacing was not applied to lexical list items and quotes, since those are not part of paragraph nodes. As a result, text appeared wider / less narrow within lists compared to paragraphs
1 parent 039e6c9 commit f2397a8

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

packages/richtext-lexical/src/lexical/theme/EditorTheme.scss

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
@import '~@payloadcms/ui/scss';
22

33
@layer payload-default {
4+
@mixin textBase {
5+
font-size: base(0.8);
6+
line-height: 1.5;
7+
letter-spacing: normal;
8+
}
9+
410
.LexicalEditorTheme {
511
&__ltr {
612
text-align: left;
@@ -11,17 +17,15 @@
1117
}
1218

1319
&__paragraph {
14-
font-size: base(0.8);
20+
@include textBase;
1521
margin-bottom: 0.55em;
1622
position: relative;
17-
line-height: 1.5;
18-
letter-spacing: normal;
1923
color: var(--theme-text);
2024
}
2125

2226
&__quote {
27+
@include textBase;
2328
color: var(--theme-text);
24-
font-size: base(0.8);
2529
margin-block: base(0.8);
2630
margin-inline: base(0.2);
2731
border-inline-start-color: var(--theme-elevation-150);
@@ -37,6 +41,7 @@
3741
&__h4,
3842
&__h5,
3943
&__h6 {
44+
@include textBase;
4045
font-family: var(--font-body);
4146
line-height: 1.125;
4247
letter-spacing: 0;
@@ -74,6 +79,7 @@
7479
}
7580

7681
&__h6 {
82+
@include textBase;
7783
font-size: base(0.8);
7884
font-weight: 700;
7985
margin-block: 0.75em 0.4em;
@@ -241,7 +247,7 @@
241247
}
242248

243249
&__listItem {
244-
font-size: base(0.8);
250+
@include textBase;
245251
margin: 0 0 0.4em 40px;
246252
color: var(--theme-text);
247253
}

0 commit comments

Comments
 (0)