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.

left_sidebar: Add offset to unreads to make New topic appear centered.

Karl Stolley1fae8931c3c6
diff --git a/web/styles/app_variables.css b/web/styles/app_variables.css
index f6582bbc8f0..18499cc0485 100644
--- a/web/styles/app_variables.css
+++ b/web/styles/app_variables.css
@@ -236,6 +236,8 @@
/* This represents the space in the sidebar reserved for symbols like
the #; labels like the stream name go to the right of this. */
--left-sidebar-icon-column-width: 16px;
+ /* Offset on unreads to make New topic button appear centered. */
+ --left-sidebar-unread-offset: 6.5px;
/* space direct message / stream / topic names from unread counters
and @ mention indicators by 3px on the right */
--left-sidebar-before-unread-count-padding: 3px;
diff --git a/web/styles/left_sidebar.css b/web/styles/left_sidebar.css
index 2e6c1a8932e..5b647462f50 100644
--- a/web/styles/left_sidebar.css
+++ b/web/styles/left_sidebar.css
@@ -228,6 +228,12 @@
display: flex;
gap: 5px;
align-items: center;
+ /* Extra margin for unreads. */
+ margin-right: var(--left-sidebar-unread-offset);
+
+ &:has(.unread_count:empty) {
+ margin-right: 0;
+ }
}
#show-all-direct-messages {
@@ -764,6 +770,12 @@ li.top_left_scheduled_messages {
.unread_count {
grid-area: markers-and-unreads;
+ /* Extra margin for unreads. */
+ margin-right: var(--left-sidebar-unread-offset);
+
+ &:empty {
+ margin-right: 0;
+ }
}
}
@@ -772,6 +784,8 @@ li.top_left_scheduled_messages {
.masked_unread_count {
display: flex;
grid-area: markers-and-unreads;
+ /* Extra margin for unreads. */
+ margin-right: var(--left-sidebar-unread-offset);
}
.unread_count {
@@ -1185,6 +1199,12 @@ li.top_left_scheduled_messages {
gap: 5px;
align-items: center;
justify-content: center;
+ /* Extra margin for unreads. */
+ margin-right: var(--left-sidebar-unread-offset);
+
+ &:has(.unread_count:empty) {
+ margin-right: 0;
+ }
.unread_mention_info {
/* Unset margin in favor of flex gap. */
@@ -1437,6 +1457,12 @@ li.topic-list-item {
16px-high unread box. */
display: flex;
align-items: center;
+ /* Extra margin for unreads. */
+ margin-right: var(--left-sidebar-unread-offset);
+
+ &:empty {
+ margin-right: 0;
+ }
}
}
@@ -1494,6 +1520,12 @@ li.topic-list-item {
.unread_count {
grid-area: markers-and-unreads;
+ /* Extra margin for unreads. */
+ margin-right: var(--left-sidebar-unread-offset);
+
+ &:empty {
+ margin-right: 0;
+ }
}
}
@@ -1551,6 +1583,12 @@ li.topic-list-item {
display: flex;
align-items: center;
grid-gap: 5px;
+ /* Extra margin for unreads. */
+ margin-right: var(--left-sidebar-unread-offset);
+
+ &:has(.unread_count:empty) {
+ margin-right: 0;
+ }
}
#filter_streams_tooltip {