Skip to content

Commit 5aa2708

Browse files
committed
Move spinner CSS to separate partial
1 parent 58eedd6 commit 5aa2708

File tree

2 files changed

+33
-34
lines changed

2 files changed

+33
-34
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Loading indicator for turbo frame updates
2+
// https://discuss.hotwired.dev/t/show-spinner-everytime-async-frame-reloads/3483/3
3+
@keyframes spinner {
4+
to {
5+
transform: rotate(360deg);
6+
}
7+
}
8+
9+
[busy]:not([no-spinner]) {
10+
position: relative;
11+
12+
> * {
13+
opacity: 0.5;
14+
}
15+
16+
&::after {
17+
content: '';
18+
box-sizing: border-box;
19+
position: fixed;
20+
top: 50%;
21+
left: 50%;
22+
width: 2.5rem;
23+
height: 2.5rem;
24+
margin-top: -1.25rem;
25+
margin-left: -1.25rem;
26+
border-radius: 50%;
27+
border: 0.275rem solid rgba($color-red-500, 0.3);
28+
border-top-color: $color-red-500;
29+
animation: spinner 0.6s linear infinite;
30+
z-index: 9999;
31+
}
32+
}

app/assets/stylesheets/partials/_results.scss

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -118,37 +118,4 @@
118118
font-size: 1.8rem;
119119
line-height: 1.1;
120120
}
121-
}
122-
123-
// Loading indicator for turbo frame updates
124-
// https://discuss.hotwired.dev/t/show-spinner-everytime-async-frame-reloads/3483/3
125-
@keyframes spinner {
126-
to {
127-
transform: rotate(360deg);
128-
}
129-
}
130-
131-
[busy]:not([no-spinner]) {
132-
position: relative;
133-
134-
> * {
135-
opacity: 0.5;
136-
}
137-
138-
&::after {
139-
content: '';
140-
box-sizing: border-box;
141-
position: fixed;
142-
top: 50%;
143-
left: 50%;
144-
width: 2.5rem;
145-
height: 2.5rem;
146-
margin-top: -1.25rem;
147-
margin-left: -1.25rem;
148-
border-radius: 50%;
149-
border: 0.275rem solid rgba($color-red-500, 0.3);
150-
border-top-color: $color-red-500;
151-
animation: spinner 0.6s linear infinite;
152-
z-index: 9999;
153-
}
154-
}
121+
}

0 commit comments

Comments
 (0)