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_header: Build message_header.css from zulip.css header styles.

Karl Stolley165df5f1f6ea
diff --git a/web/src/bundles/app.ts b/web/src/bundles/app.ts
index 7438d14a3dc..cb9d3ea433d 100644
--- a/web/src/bundles/app.ts
+++ b/web/src/bundles/app.ts
@@ -31,6 +31,7 @@ import "../../styles/components.css";
import "../../styles/app_components.css";
import "../../styles/rendered_markdown.css";
import "../../styles/zulip.css";
+import "../../styles/message_header.css";
import "../../styles/message_row.css";
import "../../styles/modal.css";
import "../../styles/settings.css";
diff --git a/web/styles/message_header.css b/web/styles/message_header.css
new file mode 100644
index 00000000000..b5a715f452e
--- /dev/null
+++ b/web/styles/message_header.css
@@ -0,0 +1,270 @@
+.message_header {
+ vertical-align: middle;
+ text-align: left;
+ /* We can overflow-y if the font size gets big */
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ font-weight: 600;
+ font-size: calc(15em / 14);
+ line-height: 120%;
+ position: relative;
+ z-index: 0;
+ background-color: var(--color-background);
+
+ .message-header-contents {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ height: 28px;
+ border: 1px solid var(--color-message-header-contents-border);
+ border-bottom-color: var(--color-message-header-contents-border-bottom);
+ border-radius: 7px 7px 0 0;
+ }
+
+ &.message_header_stream {
+ /* Add box shadow to hide message border (first one) and message
+ selected box shadow (second one) that are visible
+ due to top borders of sticky recipient bar being curved. */
+ box-shadow:
+ -1px -5px 0 5px var(--color-background),
+ 1px -5px 0 0 var(--color-background);
+
+ & a.message_label_clickable {
+ color: var(--color-text-message-header);
+
+ &:hover {
+ color: var(--color-text-message-header) !important;
+ text-decoration: none;
+ }
+ }
+
+ .stream_topic_separator {
+ line-height: 0;
+ color: var(--color-message-header-icon-non-interactive);
+ position: relative;
+ top: 0.5px;
+ }
+
+ .stream_topic {
+ display: inline-block;
+ padding: 5px 6px 5px 2px;
+ height: 17px;
+ line-height: 17px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+
+ .message_label_clickable.narrows_by_topic {
+ position: relative;
+ top: 0.5px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+ }
+
+ .stream-privacy i {
+ font-size: 15px;
+
+ &.zulip-icon-globe,
+ &.zulip-icon-hashtag {
+ position: relative;
+ top: -0.5px;
+ }
+ }
+ }
+}
+
+.message_header_private_message {
+ /* This is required for box-shadow appear above the message content. */
+ z-index: 1;
+ box-shadow:
+ -1px -5px 0 5px var(--color-background),
+ 1px -5px 0 0 var(--color-background);
+ background-color: var(--color-background);
+
+ .message-header-contents {
+ border-color: var(--color-private-message-header-border);
+ border-bottom-color: var(--color-private-message-header-border-bottom);
+ background-color: var(--color-background-private-message-header);
+ }
+
+ .message_label_clickable {
+ display: flex;
+ padding: 5px 0 5px 10px;
+ font-weight: 600;
+ height: 17px;
+ line-height: 17px;
+ color: var(--color-text-message-header);
+
+ &:hover {
+ color: var(--color-text-message-header) !important;
+ text-decoration: none;
+ }
+
+ .private_message_header_icon {
+ font-size: 15px;
+ position: relative;
+ top: 1px;
+ width: 16px;
+ height: 16px;
+ }
+
+ .private_message_header_name {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+ }
+}
+
+.message-feed {
+ .recipient_row {
+ /* Browser overlaps extra top padding of message header and
+ the bottom border message if this margin is not present. */
+ margin-bottom: 1px;
+ border-radius: 5px;
+
+ .message_row:last-of-type {
+ border-radius: 0 0 7px 7px;
+ border-bottom: 1px solid var(--color-message-list-border);
+
+ .unread-marker-fill {
+ border-radius: 0 0 0 7px;
+ height: calc(100% - 2px);
+ }
+
+ .messagebox {
+ border-radius: 0 0 7px 7px;
+ padding-bottom: 4px;
+ }
+ }
+
+ .message_header + .message_row {
+ .messagebox {
+ padding-top: 5px;
+ }
+ }
+ }
+
+ .message_header {
+ position: sticky;
+ top: var(--navbar-fixed-height);
+ /* Needs to be higher than the z-index of date_row. */
+ z-index: 4;
+ box-shadow: 0 -1px 0 0 var(--color-background);
+
+ .message-header-contents {
+ margin-top: var(--header-padding-bottom);
+ }
+
+ &.sticky_header {
+ box-shadow: var(--unread-marker-left) 0 0 0 var(--color-background);
+
+ .recipient_row_date {
+ display: block;
+ }
+ }
+ }
+}
+
+.stream_label {
+ display: flex;
+ align-items: center;
+ gap: 5px;
+ padding: 5px 2px 5px 10px;
+ height: 17px;
+ line-height: 17px;
+ position: relative;
+ top: 0.5px;
+ text-decoration: none;
+ font-weight: 600;
+ overflow: hidden;
+
+ .recipient-row-stream-icon {
+ font-size: 12px;
+ line-height: 12px;
+ }
+
+ .zulip-icon.zulip-icon-globe {
+ position: relative;
+ top: 1px;
+ }
+
+ &:hover {
+ text-decoration: none;
+ }
+
+ .stream-privacy {
+ min-width: unset;
+ width: 16px;
+ height: 16px;
+
+ .hashtag {
+ padding-right: 0;
+
+ &::after {
+ font-size: 16px;
+ }
+ }
+ }
+}
+
+.recipient_bar_controls {
+ display: flex;
+ flex-grow: 1;
+ align-items: center;
+
+ .external-topic-link {
+ /* Vertically center the external link
+ icon inside its containing anchor. */
+ display: flex;
+ align-items: center;
+ }
+
+ .change_visibility_policy {
+ cursor: pointer;
+
+ i {
+ display: block;
+ }
+ }
+}
+
+.recipient_row_date {
+ color: var(--color-date);
+ font-size: calc(12em / 14);
+ padding: 0 10px;
+ text-align: right;
+ display: flex;
+ align-items: center;
+ font-style: normal;
+ font-weight: 600;
+ line-height: 17px; /* identical to box height, or 131% */
+ letter-spacing: 0.04em;
+ text-transform: uppercase;
+ padding-top: 1px;
+
+ /* Display the date when unchanged only for sticky headers. */
+ &.recipient_row_date_unchanged {
+ display: none;
+
+ .sticky_header & {
+ display: block;
+ }
+ }
+
+ &.hide-date-separator-header {
+ display: none;
+ }
+}
+
+.recipient_bar_icon {
+ color: var(--color-message-header-icon-interactive);
+ opacity: 0.2;
+ padding-left: 6px;
+ padding-right: 6px;
+
+ &:hover {
+ opacity: 0.4 !important;
+ cursor: pointer;
+ }
+}
diff --git a/web/styles/zulip.css b/web/styles/zulip.css
index 6388c1fef10..fe92e0aca05 100644
--- a/web/styles/zulip.css
+++ b/web/styles/zulip.css
@@ -1037,235 +1037,6 @@ td.pointer {
}
}
-.message_header {
- vertical-align: middle;
- text-align: left;
- /* We can overflow-y if the font size gets big */
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-weight: 600;
- font-size: calc(15em / 14);
- line-height: 120%;
- position: relative;
- z-index: 0;
- background-color: var(--color-background);
-
- .message-header-contents {
- display: flex;
- align-items: center;
- justify-content: space-between;
- height: 28px;
- border: 1px solid var(--color-message-header-contents-border);
- border-bottom-color: var(--color-message-header-contents-border-bottom);
- border-radius: 7px 7px 0 0;
- }
-
- &.message_header_stream {
- /* Add box shadow to hide message border (first one) and message
- selected box shadow (second one) that are visible
- due to top borders of sticky recipient bar being curved. */
- box-shadow:
- -1px -5px 0 5px var(--color-background),
- 1px -5px 0 0 var(--color-background);
-
- & a.message_label_clickable {
- color: var(--color-text-message-header);
-
- &:hover {
- color: var(--color-text-message-header) !important;
- text-decoration: none;
- }
- }
-
- .stream_topic_separator {
- line-height: 0;
- color: var(--color-message-header-icon-non-interactive);
- position: relative;
- top: 0.5px;
- }
-
- .stream_topic {
- display: inline-block;
- padding: 5px 6px 5px 2px;
- height: 17px;
- line-height: 17px;
- overflow: hidden;
- text-overflow: ellipsis;
-
- .message_label_clickable.narrows_by_topic {
- position: relative;
- top: 0.5px;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- }
-
- .stream-privacy i {
- font-size: 15px;
-
- &.zulip-icon-globe,
- &.zulip-icon-hashtag {
- position: relative;
- top: -0.5px;
- }
- }
- }
-}
-
-.message-feed {
- .recipient_row {
- /* Browser overlaps extra top padding of message header and
- the bottom border message if this margin is not present. */
- margin-bottom: 1px;
- border-radius: 5px;
-
- .message_row:last-of-type {
- border-radius: 0 0 7px 7px;
- border-bottom: 1px solid var(--color-message-list-border);
-
- .unread-marker-fill {
- border-radius: 0 0 0 7px;
- height: calc(100% - 2px);
- }
-
- .messagebox {
- border-radius: 0 0 7px 7px;
- padding-bottom: 4px;
- }
- }
-
- .message_header + .message_row {
- .messagebox {
- padding-top: 5px;
- }
- }
- }
-
- .message_header {
- position: sticky;
- top: var(--navbar-fixed-height);
- /* Needs to be higher than the z-index of date_row. */
- z-index: 4;
- box-shadow: 0 -1px 0 0 var(--color-background);
-
- .message-header-contents {
- margin-top: var(--header-padding-bottom);
- }
-
- &.sticky_header {
- box-shadow: var(--unread-marker-left) 0 0 0 var(--color-background);
-
- .recipient_row_date {
- display: block;
- }
- }
- }
-}
-
-.stream_label {
- display: flex;
- align-items: center;
- gap: 5px;
- padding: 5px 2px 5px 10px;
- height: 17px;
- line-height: 17px;
- position: relative;
- top: 0.5px;
- text-decoration: none;
- font-weight: 600;
- overflow: hidden;
-
- .recipient-row-stream-icon {
- font-size: 12px;
- line-height: 12px;
- }
-
- .zulip-icon.zulip-icon-globe {
- position: relative;
- top: 1px;
- }
-
- &:hover {
- text-decoration: none;
- }
-
- .stream-privacy {
- min-width: unset;
- width: 16px;
- height: 16px;
-
- .hashtag {
- padding-right: 0;
-
- &::after {
- font-size: 16px;
- }
- }
- }
-}
-
-.recipient_bar_controls {
- display: flex;
- flex-grow: 1;
- align-items: center;
-
- .external-topic-link {
- /* Vertically center the external link
- icon inside its containing anchor. */
- display: flex;
- align-items: center;
- }
-
- .change_visibility_policy {
- cursor: pointer;
-
- i {
- display: block;
- }
- }
-}
-
-.recipient_row_date {
- color: var(--color-date);
- font-size: calc(12em / 14);
- padding: 0 10px;
- text-align: right;
- display: flex;
- align-items: center;
- font-style: normal;
- font-weight: 600;
- line-height: 17px; /* identical to box height, or 131% */
- letter-spacing: 0.04em;
- text-transform: uppercase;
- padding-top: 1px;
-
- /* Display the date when unchanged only for sticky headers. */
- &.recipient_row_date_unchanged {
- display: none;
-
- .sticky_header & {
- display: block;
- }
- }
-
- &.hide-date-separator-header {
- display: none;
- }
-}
-
-.recipient_bar_icon {
- color: var(--color-message-header-icon-interactive);
- opacity: 0.2;
- padding-left: 6px;
- padding-right: 6px;
-
- &:hover {
- opacity: 0.4 !important;
- cursor: pointer;
- }
-}
-
.copy-paste-text {
/* Hide the text that we want copy paste to capture */
position: absolute;
@@ -1304,48 +1075,6 @@ td.pointer {
}
}
-.message_header_private_message {
- /* This is required for box-shadow appear above the message content. */
- z-index: 1;
- box-shadow:
- -1px -5px 0 5px var(--color-background),
- 1px -5px 0 0 var(--color-background);
- background-color: var(--color-background);
-
- .message-header-contents {
- border-color: var(--color-private-message-header-border);
- border-bottom-color: var(--color-private-message-header-border-bottom);
- background-color: var(--color-background-private-message-header);
- }
-
- .message_label_clickable {
- display: flex;
- padding: 5px 0 5px 10px;
- font-weight: 600;
- height: 17px;
- line-height: 17px;
- color: var(--color-text-message-header);
-
- &:hover {
- color: var(--color-text-message-header) !important;
- text-decoration: none;
- }
-
- .private_message_header_icon {
- font-size: 15px;
- position: relative;
- top: 1px;
- width: 16px;
- height: 16px;
- }
-
- .private_message_header_name {
- overflow: hidden;
- text-overflow: ellipsis;
- }
- }
-}
-
.selected_message {
.messagebox-content {
/* We add an outline and shift it inside the message so that without