Skip to content

Commit 7c0e0bf

Browse files
committed
refactorize CSS styling to ThreeDotsLoader snippet
1 parent bdf1f6f commit 7c0e0bf

File tree

1 file changed

+21
-29
lines changed

1 file changed

+21
-29
lines changed

components/Snippets/ThreeDotsLoader.js

+21-29
Original file line numberDiff line numberDiff line change
@@ -76,42 +76,34 @@ const exampleWrapper = styled('div', {
7676
});`;
7777

7878
const cssStyling = `
79-
.exampleClass {
80-
position: relative;
81-
width: 14px;
82-
height: 14px;
83-
border-radius: 50%;
84-
background-color: white;
85-
color: white;
86-
animation: flashing 0.8s infinite linear alternate .4s;
87-
}
88-
89-
.exampleClass::after,
90-
.exampleClass::before {
91-
content: '';
92-
display: inline-block;
93-
position: absolute;
94-
top: 0;
95-
width: 14px;
96-
height: 14px;
97-
border-radius: 50%;
98-
background-color: white;
99-
color: white;
79+
.exampleClass span {
80+
width: 14px;
81+
height: 14px;
82+
borderRadius: 50%;
83+
backgroundColor: white;
84+
animation: flashing 1.4s infinite linear;
85+
margin: 0 4px;
86+
display: inline-block;
10087
}
10188
102-
.exampleClass::before {
103-
left: -21px;
104-
animation: flashing 0.8s infinite alternate;
89+
.exampleClass span:nth-child(2) {
90+
animation-delay: .2s;
10591
}
10692
107-
.exampleClass::after {
108-
left: 21px;
109-
animation: flashing 0.8s infinite alternate .8s;
93+
.exampleClass span:nth-child(3) {
94+
animation-delay: .4s;
11095
}
11196
11297
@keyframes flashing {
113-
0% { background-color: white }
114-
50%, 100% { background-color: rgba(255, 255, 255, 0.3) }
98+
0% {
99+
opacity: 0.2;
100+
}
101+
20% {
102+
opacity: 1;
103+
},
104+
100% {
105+
opacity: 0.2;
106+
}
115107
}
116108
`;
117109

0 commit comments

Comments
 (0)