Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

grid: Use message_time to maintain baseline group.

Karl Stolley72119d161b02
diff --git a/web/styles/message_row.css b/web/styles/message_row.css
index f3b16969e9e..1a1e7e90a5e 100644
--- a/web/styles/message_row.css
+++ b/web/styles/message_row.css
@@ -167,6 +167,25 @@ $time_column_min_width: 50px; /* + padding */
.message_time {
justify-self: end;
padding-right: 5px;
+ /* Maintain first-line baseline regardless of
+ what happens in the message-content area (e.g., a
+ collapsed message, or source/edit view). This
+ line-height also keeps EDITED/MOVED messages
+ in place, care of their baseline-group participation
+ within the grid.
+
+ That said, 28px is a bit of a magical number.
+ In theory, this should be 27px. That's the height
+ of a single-message row without a sender. (See the
+ calculations for the height of a single-line,
+ sender-less message row in the message box grid.)
+ But when shifting into collapsed or source views,
+ 28px is necessary to maintain the vertical alignment
+ of the EDITED messages, hover controls, and
+ timestamp. It's possible that this is also due to a
+ a rounding error, given how --message-box-line-height
+ is expressed as a unitless decimal. */
+ line-height: 28px;
text-align: end;
grid-area: time;
@@ -346,6 +365,10 @@ $time_column_min_width: 50px; /* + padding */
.message_time {
grid-area: time;
+ /* Don't adjust the line-height for collapsed or
+ edited/source messages when there's a sender,
+ as the sender text is always visible. */
+ line-height: inherit;
}
.slow-send-spinner {