aboutsummaryrefslogtreecommitdiffstats
path: root/app/assets/stylesheets/utilities/_loading.scss
diff options
context:
space:
mode:
authorsadbeast <sadbeast@sadbeast.com>2024-01-31 17:47:56 -0800
committersadbeast <sadbeast@sadbeast.com>2024-01-31 17:47:56 -0800
commit332ec93366315fa1ed7b4acd7a3407c96e8ddfa7 (patch)
tree6ae553317f12a7a6a29c849c8805ffab96436dc2 /app/assets/stylesheets/utilities/_loading.scss
downloadtd-main.tar.gz
td-main.tar.bz2
initial mistakeHEADmain
Diffstat (limited to 'app/assets/stylesheets/utilities/_loading.scss')
-rw-r--r--app/assets/stylesheets/utilities/_loading.scss58
1 files changed, 58 insertions, 0 deletions
diff --git a/app/assets/stylesheets/utilities/_loading.scss b/app/assets/stylesheets/utilities/_loading.scss
new file mode 100644
index 0000000..c6f3afe
--- /dev/null
+++ b/app/assets/stylesheets/utilities/_loading.scss
@@ -0,0 +1,58 @@
+/**
+ * Loading ([aria-busy=true])
+ */
+
+
+// Cursor
+[aria-busy="true"] {
+ cursor: progress;
+}
+
+// Everyting except form elements
+[aria-busy="true"]:not(input, select, textarea, html) {
+
+ &::before {
+ display: inline-block;
+ width: 1em;
+ height: 1em;
+ border: 0.1875em solid currentColor;
+ border-radius: 1em;
+ border-right-color: transparent;
+ content: "";
+ vertical-align: text-bottom;
+ vertical-align: -.125em; // Visual alignment
+ animation: spinner 0.75s linear infinite;
+ opacity: var(--loading-spinner-opacity);
+ }
+
+ &:not(:empty) {
+ &::before {
+ margin-right: calc(var(--spacing) * 0.5);
+ margin-left: 0;
+ margin-inline-start: 0;
+ margin-inline-end: calc(var(--spacing) * 0.5);
+ }
+ }
+
+ &:empty {
+ text-align: center;
+ }
+}
+
+// Buttons and links
+button,
+input[type="submit"],
+input[type="button"],
+input[type="reset"],
+a {
+ &[aria-busy="true"] {
+ pointer-events: none;
+ }
+}
+
+// Animation: rotate
+@keyframes spinner {
+ to {
+ transform: rotate(360deg);
+ }
+}