Skip to content

Commit

Permalink
Align filter selector and filter control button
Browse files Browse the repository at this point in the history
  • Loading branch information
podliashanyk committed Jan 14, 2025
1 parent f2de849 commit 86a0dba
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
28 changes: 18 additions & 10 deletions src/argus/htmx/static/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -3191,6 +3191,10 @@ details.collapse summary::-webkit-details-marker {
}
}

.select-bordered {
border-color: var(--fallback-bc,oklch(var(--bc)/0.2));
}

.select:focus {
box-shadow: none;
border-color: var(--fallback-bc,oklch(var(--bc)/0.2));
Expand All @@ -3200,16 +3204,6 @@ details.collapse summary::-webkit-details-marker {
outline-color: var(--fallback-bc,oklch(var(--bc)/0.2));
}

.select-ghost {
--tw-bg-opacity: 0.05;
}

.select-ghost:focus {
--tw-bg-opacity: 1;
--tw-text-opacity: 1;
color: var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));
}

.select-accent {
--tw-border-opacity: 1;
border-color: var(--fallback-a,oklch(var(--a)/var(--tw-border-opacity)));
Expand Down Expand Up @@ -3808,6 +3802,20 @@ details.collapse summary::-webkit-details-marker {
--filler-offset: 0.4rem;
}

.select-sm {
height: 2rem;
min-height: 2rem;
padding-left: 0.75rem;
padding-right: 2rem;
font-size: 0.875rem;
line-height: 2rem;
}

[dir="rtl"] .select-sm {
padding-left: 2rem;
padding-right: 0.75rem;
}

.select-xs {
height: 1.5rem;
min-height: 1.5rem;
Expand Down
2 changes: 1 addition & 1 deletion src/argus/htmx/templates/htmx/_base_form_modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h3 class="card-title">{{ header }}</h3>
<div class="divider divider-end">
<button type="submit"
form="{{ dialog_id }}-form"
class="btn {{ button_class|default:'btn-primary' }}">
class="btn btn-primary">
<span>{{ submit_text }}</span>
</button>
<button class="btn">{{ cancel_text }}</button>
Expand Down
6 changes: 4 additions & 2 deletions src/argus/htmx/templates/htmx/incident/_filter_controls.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
{% include "htmx/incident/_filter_select.html" %}
{% include "htmx/incident/_filter_create_modal.html" with dialog_id="create-filter-dialog" button_title="Create filter" header="Create new filter" explanation="Create new filter from currently selected filter parameters" cancel_text="Cancel" submit_text="Submit" %}
<div class="join join-horizontal items-center">
{% include "htmx/incident/_filter_select.html" %}
{% include "htmx/incident/_filter_create_modal.html" with dialog_id="create-filter-dialog" button_title="Create filter" button_class="btn-sm join-item" header="Create new filter" explanation="Create new filter from currently selected filter parameters" cancel_text="Cancel" submit_text="Submit" %}
</div>
2 changes: 1 addition & 1 deletion src/argus/htmx/templates/htmx/incident/filter_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<span class="block label">
<span class="label-text">Filter</span>
</span>
<select class="select select-ghost w-full max-w-xs"
<select class="select select-bordered select-sm join-item w-full max-w-xs"
id="incident-filter-select"
name="filter"
hx-get="{% url 'htmx:select-filter' %}"
Expand Down

0 comments on commit 86a0dba

Please sign in to comment.