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.

icons: Add microlayout for new icons.

Karl Stolleyb0c428edf1a0
diff --git a/web/styles/message_row.css b/web/styles/message_row.css
index 3c6fcfbe3bf..4b430e2f441 100644
--- a/web/styles/message_row.css
+++ b/web/styles/message_row.css
@@ -13,7 +13,7 @@ $message_box_margin: 3px;
wider for individual messages if required, up to `max-content`, to
prevent ugly line-wrapping. In practice, it's unlikely we'll see
anything wider than 60px. */
-$time_column_min_width: 50px; /* + padding */
+$time_column_min_width: 42px; /* + padding */
.message_row {
display: grid;
@@ -124,11 +124,9 @@ $time_column_min_width: 50px; /* + padding */
align-items: baseline;
padding-left: 10px;
grid-template:
- 25px repeat(3, auto) /
- $avatar_column_width auto 55px 3px minmax(
- $time_column_min_width,
- max-content
- );
+ var(--message-box-icon-height) repeat(3, auto) /
+ $avatar_column_width auto calc(3 * var(--message-box-icon-width))
+ 8px minmax($time_column_min_width, max-content);
/* Named grid areas provide flexibility for positioning grid items
reliably, even if the row or column definitions of the grid change. */
grid-template-areas:
@@ -138,7 +136,7 @@ $time_column_min_width: 50px; /* + padding */
". reactions . . . ";
@media (width < $sm_min) {
- grid-template-columns: $avatar_column_width auto max-content 3px minmax(
+ grid-template-columns: $avatar_column_width auto max-content 8px minmax(
$time_column_min_width,
max-content
);
diff --git a/web/styles/zulip.css b/web/styles/zulip.css
index 574c53d927c..8c8af7845d8 100644
--- a/web/styles/zulip.css
+++ b/web/styles/zulip.css
@@ -88,6 +88,8 @@ body {
--message-box-avatar-width: 35px;
--message-box-avatar-height: var(--message-box-avatar-width);
--message-box-line-height: 1.214;
+ --message-box-icon-width: 26px;
+ --message-box-icon-height: 25px;
/*
Left position of unread marker. Only needs to be tracked if it is negative so that
@@ -1174,6 +1176,8 @@ td.pointer {
}
.message_controls {
+ display: flex;
+ align-items: baseline;
font-size: 16px;
/* This is a bit tricky; we need to reserve space for the message
controls even when the message isn't hovered, so that hover
@@ -1184,10 +1188,9 @@ td.pointer {
opacity: 0;
visibility: hidden;
transition: all 0.2s ease;
- width: 16px;
+ width: var(--message-box-icon-width);
+ height: var(--message-box-icon-height);
text-align: center;
- display: inline-block;
- position: relative;
color: var(--color-message-action-visible);
> i {
@@ -1227,7 +1230,12 @@ td.pointer {
}
.edit_content {
- width: 12px;
+ /* Icons for editing content are determined on message hover;
+ we set an empty `.edit_content` to have 0 height in order to
+ preserve the layout of the other icons prior to any hovering. */
+ &:empty {
+ height: 0;
+ }
&:hover {
cursor: pointer;