Skip to content

Commit 7a3507d

Browse files
authored
fix(richtext-lexical): toolbar styles (#7936)
fix #7925. The `active` style was not effective due to a typo in the CSS (`them` instead of `theme`). I took the opportunity to improve a few things: - Now the colors on hover, active, and hover+active are slightly different. - Added a missing gap to the fixed toolbar buttons. Gap changes: Before: ![CleanShot 2024-09-03 at 00 02 52@2x](https://github.com/user-attachments/assets/2381468c-7bdd-43f6-93b6-5baa587dd0a6) After: ![CleanShot 2024-09-03 at 00 01 22@2x](https://github.com/user-attachments/assets/53d0cac9-9718-4b97-a478-f249b10d416e) Thanks @tylandavis for the help!
1 parent 9bcdf0d commit 7a3507d

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

packages/richtext-lexical/src/features/toolbars/fixed/client/Toolbar/index.scss

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ html[data-theme='dark'] {
2121
}
2222

2323
.toolbar-popup {
24-
&__button {
25-
&.active,
26-
&:hover:not([disabled]) {
27-
background: var(--theme-elevation-100);
28-
}
29-
}
30-
3124
&__dropdown {
3225
transition: background-color 0.15s cubic-bezier(0, 0.2, 0.2, 1);
3326

@@ -73,7 +66,7 @@ html[data-theme='dark'] {
7366
display: flex;
7467
flex-wrap: wrap;
7568
align-items: center;
76-
gap: 0;
69+
gap: 2px;
7770
z-index: 1;
7871

7972
.icon {
@@ -86,7 +79,7 @@ html[data-theme='dark'] {
8679
width: 1px;
8780
height: 15px;
8881
background-color: var(--theme-elevation-100);
89-
margin: 0 6.25px;
82+
margin: 0 6.25px 0 4.25px; // substract 2px from the gap
9083
}
9184
}
9285

packages/richtext-lexical/src/features/toolbars/inline/client/Toolbar/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.inline-toolbar-popup {
44
display: flex;
55
align-items: center;
6-
background: var(--theme-elevation-50);
6+
background: var(--theme-input-bg);
77
padding: base(0.2);
88
vertical-align: middle;
99
position: absolute;

packages/richtext-lexical/src/features/toolbars/shared/ToolbarButton/index.scss

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,16 @@
1818
margin-right: 2px;
1919
}
2020

21+
&:hover:not([disabled]) {
22+
background-color: var(--theme-elevation-100);
23+
}
24+
2125
&.active {
22-
background-color: var(--them-elevation-150);
26+
background-color: var(--theme-elevation-150);
2327
color: var(--theme-text);
28+
&:hover {
29+
background-color: var(--theme-elevation-200);
30+
}
2431

2532
.icon {
2633
opacity: 1;
@@ -34,8 +41,4 @@
3441
opacity: 0.2;
3542
}
3643
}
37-
38-
&:hover:not([disabled]) {
39-
background-color: var(--theme-elevation-100);
40-
}
4144
}

0 commit comments

Comments
 (0)