Skip to content

Commit 58899ee

Browse files
committed
Refactor ChatMessage CSS for consistent button styling
1 parent f3e0854 commit 58899ee

File tree

1 file changed

+37
-36
lines changed

1 file changed

+37
-36
lines changed

mito-ai/style/ChatMessage.css

+37-36
Original file line numberDiff line numberDiff line change
@@ -56,72 +56,73 @@
5656
align-items: center;
5757
}
5858

59+
/* Message Action Buttons Container */
5960
.message-action-buttons {
60-
position: absolute !important;
61-
bottom: 8px !important;
62-
right: 8px !important;
61+
position: absolute;
62+
bottom: 8px;
63+
right: 8px;
6364
display: flex;
65+
border-radius: 4px;
66+
overflow: hidden; /* Ensures inner buttons don't break the rounded corners */
6467
}
6568

66-
.message-action-buttons button {
69+
/* Common styles for action buttons */
70+
.message-action-buttons button,
71+
.message-start-editing-button {
6772
cursor: pointer;
6873
opacity: 0;
6974
transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out;
7075
background-color: var(--jp-layout-color3);
7176
border: none;
72-
padding: 0px;
73-
border-radius: 0;
7477
display: flex;
7578
align-items: center;
7679
justify-content: center;
77-
color: var(--grey-900) !important;
78-
width: 28px;
79-
height: 28px;
80-
position: relative;
81-
}
82-
83-
.message-action-buttons button svg {
8480
color: var(--jp-content-font-color1);
8581
}
8682

87-
.message-action-buttons button:first-child {
88-
border-top-left-radius: 4px;
89-
border-bottom-left-radius: 4px;
90-
}
91-
92-
.message-action-buttons button:last-child {
93-
border-top-right-radius: 4px;
94-
border-bottom-right-radius: 4px;
83+
/* Action buttons in the group */
84+
.message-action-buttons button {
85+
width: 28px;
86+
height: 28px;
87+
padding: 0;
88+
border-radius: 0; /* Remove individual button radius */
9589
}
9690

97-
.message-action-buttons button:hover {
98-
background-color: var(--jp-layout-color4);
91+
/* Add subtle separator between buttons */
92+
.message-action-buttons button:not(:last-child) {
93+
border-right: 1px solid var(--jp-border-color1);
9994
}
10095

101-
.message:hover .message-action-buttons button {
102-
opacity: 1 !important;
96+
/* Remove the individual button radius styles since we're handling it at the container level */
97+
.message-action-buttons button:first-child,
98+
.message-action-buttons button:last-child {
99+
border-radius: 0;
103100
}
104101

102+
/* Standalone edit button */
105103
.message-start-editing-button {
106-
position: relative !important;
107-
bottom: unset !important;
108-
right: unset !important;
109-
cursor: pointer;
110-
opacity: 0;
111-
transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out;
112-
background-color: var(--jp-layout-color3);
113-
border: none;
104+
position: relative;
114105
padding: 4px;
115106
border-radius: 4px;
116-
display: flex;
117-
align-items: center;
118-
color: var(--jp-content-font-color1) !important;
119107
}
120108

109+
/* SVG icon color */
110+
.message-action-buttons button svg {
111+
color: var(--jp-content-font-color1);
112+
}
113+
114+
/* Hover states */
115+
.message-action-buttons button:hover,
121116
.message-start-editing-button:hover {
122117
background-color: var(--jp-layout-color4);
123118
}
124119

120+
/* Show buttons on message hover */
121+
.message:hover .message-action-buttons button,
122+
.message:hover .message-start-editing-button {
123+
opacity: 1;
124+
}
125+
125126
.message-edit-buttons {
126127
display: flex;
127128
gap: 8px;

0 commit comments

Comments
 (0)