Skip to content

Commit

Permalink
* utilities: add css vars for load indicator.
Browse files Browse the repository at this point in the history
  • Loading branch information
catouse committed May 17, 2024
1 parent a531af8 commit 9a9d2b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/utilities/src/interactivity/loading.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.load-indicator::before,
.load-indicator::after {
@apply -opacity-0 -invisible -absolute -block -transition-all -duration-300 -delay-0;
@apply -opacity-0 -invisible -absolute -block -transition-all -duration-[--load-indicator-duration] -delay-0;
}
.load-indicator::before {
@apply -content-[attr(data-loading)] -flex -items-center -justify-center -text-sm -inset-0 -bg-canvas/70 -z-[99] -rounded-[inherit];
Expand All @@ -13,7 +13,7 @@
}
.load-indicator.loading::before,
.load-indicator.loading::after {
@apply -opacity-100 -visible -delay-500;
@apply -opacity-100 -visible -delay-[--load-indicator-delay];
}
.load-indicator.loading::after {
@apply -opacity-50 -animate-spin;
Expand Down
3 changes: 3 additions & 0 deletions lib/utilities/src/vars.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
--state-scale: .9;
--opacity-disabled: .7;
--opacity-muted: .5;

--load-indicator-duration: 300ms;
--load-indicator-delay: .5s;
}

0 comments on commit 9a9d2b1

Please sign in to comment.