Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable opacity in loading box #1090

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.d/+configurable-opacity-in-loading-box.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Made opacity of loading overlay configurable via tailwind arbitrary value (CSS custom property).

Set opacity of loading overlay in modals to 50%.
6 changes: 5 additions & 1 deletion src/argus/htmx/static/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -4055,7 +4055,7 @@ details.collapse summary::-webkit-details-marker {
/* Adds overlay */

.loading-box:has(> .htmx-indicator.htmx-request) > *:not(.htmx-indicator) {
opacity: 0.3;
opacity: var(--loading-overlay-opacity, 0.3);
}

/* Disables mouse interactions */
Expand Down Expand Up @@ -4635,6 +4635,10 @@ details.collapse summary::-webkit-details-marker {
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}

.\[--loading-overlay-opacity\:0\.5\] {
--loading-overlay-opacity: 0.5;
}

.\[--tab-border-color\:theme\(colors\.primary\)\] {
--tab-border-color: var(--fallback-p,oklch(var(--p)/1));
}
Expand Down
2 changes: 1 addition & 1 deletion src/argus/htmx/tailwindtheme/snippets/20-loading-box.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
/* Adds overlay */
.loading-box:has(> .htmx-indicator.htmx-request) > *:not(.htmx-indicator) {
opacity: 0.3;
opacity: var(--loading-overlay-opacity, 0.3);
}
/* Disables mouse interactions */
.loading-box:has(> .htmx-indicator.htmx-request) * {
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
@@ -1,7 +1,7 @@
<button class="btn {{ button_class|default:"btn-primary" }}"
onclick="htmx.find('#{{ dialog_id }}').showModal()">{{ button_title }}</button>
<dialog id="{{ dialog_id }}" class="modal">
<div class="modal-box card card-compact shadow-xl loading-box">
<div class="modal-box card card-compact shadow-xl loading-box [--loading-overlay-opacity:0.5]">
<div class="w-full">
<div class="divider divider-start">
<h3 class="card-title">{{ header }}</h3>
Expand Down
Loading