From fe8fc989128fe1cd713c69966aa634d024b59ac0 Mon Sep 17 00:00:00 2001 From: Karl Stolley Date: Fri, 6 Oct 2023 16:07:46 -0500 Subject: [PATCH] compose_banners: Structure innner

elements with .banner_message class. This also styles those inner .banner_message elements to lose margin inherited from Bootstrap. (This is now also applied to the upload-message banner.) It's better to achieve that with a class selector; using a `p` element selector would mean that such a style would be evaluated for all `

` elements in the DOM. Which is of course a whole lot, thanks to Markdown alone. Fixes: #26922 --- web/styles/compose.css | 14 +++++++++++--- .../compose_banner/not_subscribed_warning.hbs | 12 +++++++----- .../compose_banner/private_stream_warning.hbs | 4 +++- .../compose_banner/stream_does_not_exist_error.hbs | 2 +- .../compose_banner/unmute_topic_banner.hbs | 2 +- web/templates/compose_banner/wildcard_warning.hbs | 2 +- 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/web/styles/compose.css b/web/styles/compose.css index cdb5589a7a..af879d80d7 100644 --- a/web/styles/compose.css +++ b/web/styles/compose.css @@ -294,9 +294,10 @@ flex-wrap: wrap; } - & .banner_content, - & > p { - margin: 0; /* override bootstrap */ + & .banner_content { + /* Override Bootstrap when .banner_content is + a paragraph element. */ + margin: 0; /* 5px right padding + 10px left-margin of the neighbouring button will match the left padding */ padding: 8px 5px 8px 15px; /* The banner text uses a flex-basis of 150px, @@ -304,6 +305,13 @@ text lines are still comfortably readable. Still, it can grow and shrink as needed. */ flex: 1 1 150px; + + & .banner_message { + /* Override Bootstrap when .banner_content + contains an inner .banner_message + paragraph. */ + margin: 0; + } } .main-view-banner-action-button, diff --git a/web/templates/compose_banner/not_subscribed_warning.hbs b/web/templates/compose_banner/not_subscribed_warning.hbs index 6da358f7a7..a809195bd1 100644 --- a/web/templates/compose_banner/not_subscribed_warning.hbs +++ b/web/templates/compose_banner/not_subscribed_warning.hbs @@ -1,7 +1,9 @@ {{#> compose_banner }} - {{#if can_subscribe_other_users}} -

{{#tr}}{name} is not subscribed to this stream. They will not be notified unless you subscribe them.{{/tr}}

- {{else}} -

{{#tr}}{name} is not subscribed to this stream. They will not be notified if you mention them.{{/tr}}

- {{/if}} + {{/compose_banner}} diff --git a/web/templates/compose_banner/private_stream_warning.hbs b/web/templates/compose_banner/private_stream_warning.hbs index dbc662fc28..e64678393b 100644 --- a/web/templates/compose_banner/private_stream_warning.hbs +++ b/web/templates/compose_banner/private_stream_warning.hbs @@ -1,3 +1,5 @@ {{#> compose_banner }} -

{{#tr}}Warning: #{stream_name} is a private stream.{{/tr}}

+ {{/compose_banner}} diff --git a/web/templates/compose_banner/stream_does_not_exist_error.hbs b/web/templates/compose_banner/stream_does_not_exist_error.hbs index 25e1e80830..beda3cd6af 100644 --- a/web/templates/compose_banner/stream_does_not_exist_error.hbs +++ b/web/templates/compose_banner/stream_does_not_exist_error.hbs @@ -1,5 +1,5 @@ {{#> compose_banner }} -

+

+

+