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.

image_galleries: Equalize space above and below in-paragraph galleries.

Karl Stolley408635407998
diff --git a/web/styles/app_variables.css b/web/styles/app_variables.css
index 2f68dfc8476..49f5061595e 100644
--- a/web/styles/app_variables.css
+++ b/web/styles/app_variables.css
@@ -381,6 +381,9 @@
--markdown-interelement-doubled-space-px: calc(
var(--markdown-interelement-space-px) * 2
);
+ --markdown-interelement-halved-space-px: calc(
+ var(--markdown-interelement-space-px) / 2
+ );
/* Certain elements need to be fitted perfectly to
the line height; the length here can be used to set
precise heights, and in the case of square elements,
diff --git a/web/styles/rendered_markdown.css b/web/styles/rendered_markdown.css
index 94477a2377d..da17d985fc2 100644
--- a/web/styles/rendered_markdown.css
+++ b/web/styles/rendered_markdown.css
@@ -508,6 +508,14 @@
margin-bottom: var(--markdown-interelement-space-px);
}
+ /* When a gallery appears inside a paragraph, we equalize
+ the space above and below the gallery. Thanks to margin
+ collapsing, this value will have no effect when a gallery
+ is the last element in a paragraph. */
+ p .message-thumbnail-gallery {
+ margin: var(--markdown-interelement-halved-space-px) 0;
+ }
+
/* We used to use this for certain dropbox previews, we are keeping
this around as to not break any previous instances of these
previews. */