css: Add class decorated-stream-name-dropdown-widget.

This commit introduces a class
`decorated-stream-name-dropdown-widget`. The class extracts
the styles applied to channel dropdowns in commit:
9ae704510f org_settings: Correctly display long channel names,
so they can be reused at other instances.
This commit is contained in:
Saubhagya Patel
2025-06-07 14:25:35 +05:30
committed by Tim Abbott
parent 6e38b56405
commit 1471e9b828
3 changed files with 27 additions and 22 deletions

View File

@@ -415,6 +415,26 @@ input[type="checkbox"] {
}
}
.decorated-stream-name-dropdown-widget {
.dropdown_widget_value {
/* The max-width should account for the
16px-square box (at 16px/1em) for the
chevron icon. */
max-width: calc(100% - 1em);
display: flex;
align-items: baseline;
/* Mimic the space from the previous inline
layout. */
gap: 0.4ch;
}
.decorated-channel-name {
overflow-x: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.allow-subdomains,
.new-realm-domain-allow-subdomains {
margin: 0 !important;
@@ -842,24 +862,6 @@ input[type="checkbox"] {
#organization-settings {
.dropdown-widget-button {
color: hsl(0deg 0% 33%);
.dropdown_widget_value {
/* The max-width should account for the
16px-square box (at 16px/1em) for the
chevron icon. */
max-width: calc(100% - 1em);
display: flex;
align-items: baseline;
/* Mimic the space from the previous inline
layout. */
gap: 0.4ch;
}
.decorated-channel-name {
overflow-x: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}

View File

@@ -1,4 +1,4 @@
<button id="{{widget_name}}_widget" class="dropdown-widget-button" type="button" {{#if is_setting_disabled}}disabled{{/if}} {{#if disable_keyboard_focus}}tabindex="-1"{{/if}} name="{{widget_name}}">
<button id="{{widget_name}}_widget" class="dropdown-widget-button {{#if custom_classes}}{{custom_classes}}{{/if}}" type="button" {{#if is_setting_disabled}}disabled{{/if}} {{#if disable_keyboard_focus}}tabindex="-1"{{/if}} name="{{widget_name}}">
<span class="dropdown_widget_value">{{#if default_text}}{{default_text}}{{/if}}</span>
<i class="zulip-icon zulip-icon-chevron-down"></i>
</button>

View File

@@ -19,17 +19,20 @@
{{> ../dropdown_widget_with_label
widget_name="realm_new_stream_announcements_stream_id"
label=admin_settings_label.realm_new_stream_announcements_stream
value_type="number"}}
value_type="number"
custom_classes="decorated-stream-name-dropdown-widget"}}
{{> ../dropdown_widget_with_label
widget_name="realm_signup_announcements_stream_id"
label=admin_settings_label.realm_signup_announcements_stream
value_type="number"}}
value_type="number"
custom_classes="decorated-stream-name-dropdown-widget"}}
{{> ../dropdown_widget_with_label
widget_name="realm_zulip_update_announcements_stream_id"
label=admin_settings_label.realm_zulip_update_announcements_stream
value_type="number"}}
value_type="number"
custom_classes="decorated-stream-name-dropdown-widget"}}
{{> settings_checkbox
setting_name="realm_message_content_allowed_in_email_notifications"