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.

url_previews: Clamp title, description to two lines.

Karl Stolley80f101016e0b
diff --git a/web/styles/app_variables.css b/web/styles/app_variables.css
index 29d318dd065..b18c0189521 100644
--- a/web/styles/app_variables.css
+++ b/web/styles/app_variables.css
@@ -460,9 +460,12 @@
--message-box-timestamp-column-width: 0;
/* This length is the primary reference for height
- and image width on URL preview embeds.
- 80px at 14px/1em */
- --length-message-preview-embeds: 5.7143em;
+ and image width on URL preview embeds. 112px
+ comes from the height of a two-line title and a
+ two-line description at a +2 (maximum)
+ line-height setting.
+ 112px at 16px/1em */
+ --length-message-preview-embeds: 7em;
/*
Reaction container UI scaling.
diff --git a/web/styles/rendered_markdown.css b/web/styles/rendered_markdown.css
index e036892a39d..81b62feb461 100644
--- a/web/styles/rendered_markdown.css
+++ b/web/styles/rendered_markdown.css
@@ -721,6 +721,36 @@
font-size: 1.2em;
/* 5px at 16.8px (1.2 * 14px) */
margin-top: -0.2976em;
+ /* We set the markdown link colors here so
+ that the ellipsis takes it on truncated
+ lines. The ellipsis will not take an
+ underline even if we specify one, so
+ that is deliberately omitted here. */
+ color: var(--color-markdown-link);
+
+ &:hover {
+ color: var(--color-markdown-link-hover);
+ }
+
+ a {
+ /* Line-clamp lines seem to have a small
+ interline area that's not clickable
+ unless we set the anchor to display as
+ a block. */
+ display: block;
+ }
+ }
+
+ .message_embed_title,
+ .message_embed_description {
+ /* Clamp multi-line titles and descriptions
+ to two lines. */
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+ /* Break overflowing words as necessary. */
+ overflow-wrap: break-word;
}
.message_embed_image {
@@ -736,18 +766,6 @@
grid-area: data-container;
overflow: hidden;
}
-
- &::after {
- content: " ";
- grid-area: fader;
- height: 100%;
-
- background: linear-gradient(
- 0deg,
- var(--color-background-stream-message-content),
- transparent 100%
- );
- }
}
/* Although grid will automatically respond to