Skip to content

Commit 08e263e

Browse files
committed
Convert Loader to CSS modules
1 parent 15e5399 commit 08e263e

File tree

3 files changed

+29
-29
lines changed

3 files changed

+29
-29
lines changed

ui/frontend/Loader.module.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@keyframes loader-fade {
2+
0% {
3+
opacity: 0;
4+
}
5+
6+
75% {
7+
opacity: 1;
8+
}
9+
}
10+
11+
.dot {
12+
animation: loader-fade 1s;
13+
animation-iteration-count: infinite;
14+
opacity: 0;
15+
16+
&:nth-child(2) {
17+
animation-delay: 0.2s;
18+
}
19+
20+
&:nth-child(3) {
21+
animation-delay: 0.4s;
22+
}
23+
}

ui/frontend/Loader.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import React from 'react';
22

3+
import styles from './Loader.module.css';
4+
35
const Loader: React.SFC = () => (
4-
<div className="loader">
5-
<span className="loader-dot"></span>
6-
<span className="loader-dot"></span>
7-
<span className="loader-dot"></span>
6+
<div>
7+
<span className={styles.dot}></span>
8+
<span className={styles.dot}></span>
9+
<span className={styles.dot}></span>
810
</div>
911
);
1012

ui/frontend/index.scss

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -188,31 +188,6 @@ body {
188188
}
189189
}
190190

191-
@keyframes loader-fade {
192-
0% {
193-
opacity: 0;
194-
}
195-
75% {
196-
opacity: 1;
197-
}
198-
}
199-
200-
.loader {
201-
&-dot {
202-
opacity: 0;
203-
animation: loader-fade 1s;
204-
animation-iteration-count: infinite;
205-
206-
&:nth-child(2) {
207-
animation-delay: 0.2s;
208-
}
209-
210-
&:nth-child(3) {
211-
animation-delay: 0.4s;
212-
}
213-
}
214-
}
215-
216191
.language-rust_errors {
217192
.warning {
218193
color: #f79a06;

0 commit comments

Comments
 (0)