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.

message_row: Introduce CSS variable for vertical margin.

Karl Stolley3c5adfe4408e
diff --git a/web/styles/app_variables.css b/web/styles/app_variables.css
index 4866b61c589..59fafd0b842 100644
--- a/web/styles/app_variables.css
+++ b/web/styles/app_variables.css
@@ -72,6 +72,9 @@
--message-box-avatar-width: 35px;
--message-box-avatar-height: var(--message-box-avatar-width);
--message-box-avatar-column-width: 46px;
+ /* 6px appears to provide 5px of space between the avatar
+ and the selected-message outline, which is offset by -1px. */
+ --message-box-vertical-margin: 6px;
--message-box-line-height: 1.214;
--message-box-icon-width: 26px;
--message-box-icon-height: 25px;
diff --git a/web/styles/message_row.css b/web/styles/message_row.css
index 27038b302cb..b59108ac0c3 100644
--- a/web/styles/message_row.css
+++ b/web/styles/message_row.css
@@ -1,4 +1,3 @@
-$distance_of_non_text_elements_from_message_box: 6px;
$message_box_margin: 3px;
.message_row {
@@ -255,7 +254,7 @@ $message_box_margin: 3px;
is preserved from the message itself--keeping the time,
edit message, and controls at the same vertical alignment. */
align-self: start;
- margin-top: $distance_of_non_text_elements_from_message_box;
+ margin-top: var(--message-box-vertical-margin);
}
.message_length_controller {
@@ -356,7 +355,7 @@ $message_box_margin: 3px;
.message_edit {
/* Use the sender grid area for the me-message edit/view-source box */
grid-area: sender;
- margin-top: $distance_of_non_text_elements_from_message_box;
+ margin-top: var(--message-box-vertical-margin);
}
}
}
@@ -368,7 +367,7 @@ $message_box_margin: 3px;
/* Because the avatar may be the tallest element in a
single-line me message, this margin preserves the
overall height of the message box. */
- margin: $distance_of_non_text_elements_from_message_box 0;
+ margin: var(--message-box-vertical-margin) 0;
}
.status-message {