mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
banners: Hide empty banner-action-buttons using CSS.
Previously, the action buttons container was only hidden via conditional rendering in the template. This commit adds a CSS-based approach to also hide the container when it becomes empty, using the :empty pseudo-class. This ensures correct behavior if we later have a class of banners where the buttons area is dynamically updated, and buttons are removed dynamically.
This commit is contained in:
committed by
Tim Abbott
parent
3f6520e82a
commit
bfdd28c638
@@ -63,6 +63,10 @@
|
||||
gap: 0.5em; /* 8px at 16px/1em */
|
||||
}
|
||||
|
||||
.banner-action-buttons:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.banner-close-button {
|
||||
display: flex;
|
||||
grid-area: banner-close-button;
|
||||
|
@@ -9,6 +9,8 @@
|
||||
</span>
|
||||
{{#if buttons}}
|
||||
<span class="banner-action-buttons">
|
||||
{{!-- squash whitespace so :empty selector works when no buttons --}}
|
||||
{{~!-- squash whitespace --~}}
|
||||
{{#each buttons}}
|
||||
{{#if this.intent}}
|
||||
{{> action_button .}}
|
||||
@@ -16,6 +18,7 @@
|
||||
{{> action_button . intent=../intent}}
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
{{~!-- squash whitespace --~}}
|
||||
</span>
|
||||
{{/if}}
|
||||
</span>
|
||||
|
Reference in New Issue
Block a user