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.

compose: Reduce recipient-row height to 32px at 16px/1em.

Karl Stolley11de082def76
diff --git a/web/styles/app_variables.css b/web/styles/app_variables.css
index 4be49f00091..7c04f2199cb 100644
--- a/web/styles/app_variables.css
+++ b/web/styles/app_variables.css
@@ -487,9 +487,9 @@
/*
Compose-recipient box minimum height. Used in a flexbox context to
allow elements like DM pills to stack without breaking out of their
- flex item. 2.1786em is 30.5px at 14px/1em.
+ flex item. 2em is 32px at 16px/1em.
*/
- --compose-recipient-box-min-height: 2.1786em;
+ --compose-recipient-box-min-height: 2em;
/* 28px at 14px/1em */
/* Note that this variable can only be used in contexts where
the font-size doesn't deviate from the base font-size;
diff --git a/web/styles/compose.css b/web/styles/compose.css
index 550673328ce..a8002ce267b 100644
--- a/web/styles/compose.css
+++ b/web/styles/compose.css
@@ -216,6 +216,10 @@
#compose_select_recipient_widget {
border-radius: 4px !important;
+ /* This height is necessary only for the
+ DM picker, so that it does not stretch
+ open taller with multiple rows of user
+ pills. */
height: var(--compose-recipient-box-min-height);
}
@@ -1103,6 +1107,12 @@ textarea.new_message_textarea {
#stream_message_recipient_topic {
grid-area: topic;
color: var(--color-compose-recipient-box-text-color);
+ /* Keep the line-height matched to the font-size
+ for a more predictable box height.
+ This will have to be watched very closely for
+ possible regressions, such as when Unicode emoji
+ appear in the topic box. */
+ line-height: 1;
/* Override grid's effective `max-content` min-width */
overflow: hidden;
text-overflow: ellipsis;
@@ -1110,7 +1120,7 @@ textarea.new_message_textarea {
box-shadow: none;
outline: none;
- padding: 4px 6px;
+ padding: 0 6px;
/* Reset height to let `align-items: stretch` on the grid parent handle this. */
height: auto;
@@ -1121,6 +1131,7 @@ textarea.new_message_textarea {
#topic-not-mandatory-placeholder {
grid-area: topic-box;
+ align-self: center;
white-space: nowrap;
overflow-x: hidden;
text-overflow: ellipsis;
@@ -1375,10 +1386,9 @@ textarea.new_message_textarea {
}
#compose-recipient {
- /* Enforce a shared, 'normal' line-height on
- the recipient elements for baseline alignment,
- and better use of the recipient-row space. */
- line-height: normal;
+ /* Set a line-height equal to the font-size to
+ make a compact, predictably tall recipient row. */
+ line-height: 1;
display: flex;
flex: 1 1 0;
/* Use this containing flex element to