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.

css: Apply negative spread radius to message box-shadows.

Josh Klar2e825f637d57
diff --git a/static/styles/zulip.css b/static/styles/zulip.css
index fc737976f75..3f6c2512289 100644
--- a/static/styles/zulip.css
+++ b/static/styles/zulip.css
@@ -1386,7 +1386,21 @@ td.pointer {
.messagebox,
.date_row {
background-color: hsla(192, 19%, 75%, 0.2);
- box-shadow: inset 2px 0 0 0 hsl(0, 0%, 27%), -1px 0 0 0 hsl(0, 0%, 27%);
+ /* The 5th parameter here is a spread-radius, which, when negative,
+ * causes the shadow to shrink (be smaller than the target
+ * element), resulting in a visual width of 3px-1px=2px. This
+ * is a workaround for a regression found in Electron
+ * v18.3.15+ where the box-shadow with spread-radius >= 0
+ * would cause horizontal separator lines to appear between
+ * messages in the color of the left ruler. The root cause of
+ * that regression is yet unknown.
+ *
+ * Similar CSS for stream messages is present directly in the
+ * Handlebars templates, since the color used there is the
+ * stream's configured color.
+ */
+ box-shadow: inset 3px 0 0 -1px hsl(0, 0%, 27%),
+ -1px 0 0 0 hsl(0, 0%, 27%);
}
}
diff --git a/static/templates/single_message.hbs b/static/templates/single_message.hbs
index 01e16ce0998..2b75f850219 100644
--- a/static/templates/single_message.hbs
+++ b/static/templates/single_message.hbs
@@ -3,10 +3,10 @@
role="listitem">
<div class="unread_marker"><div class="unread-marker-fill"></div></div>
{{#if want_date_divider}}
- <div class="date_row no-select" {{#if msg/is_stream}}style="box-shadow: inset 2px 0px 0px 0px {{background_color}}, -1px 0px 0px 0px {{background_color}};"{{/if}}>{{{date_divider_html}}}</div>
+ <div class="date_row no-select" {{#if msg/is_stream}}style="box-shadow: inset 3px 0px 0px -1px {{background_color}}, -1px 0px 0px 0px {{background_color}};"{{/if}}>{{{date_divider_html}}}</div>
{{/if}}
<div class="messagebox {{#if next_is_same_sender}}next_is_same_sender{{/if}}"
- {{#if msg/is_stream}}style="box-shadow: inset 2px 0px 0px 0px {{background_color}}, -1px 0px 0px 0px {{background_color}};"{{/if}}>
+ {{#if msg/is_stream}}style="box-shadow: inset 3px 0px 0px -1px {{background_color}}, -1px 0px 0px 0px {{background_color}};"{{/if}}>
<div class="messagebox-content">
{{> message_body}}
</div>