Skip to content

Commit b91022a

Browse files
committed
refactorize SCSS styling to ThreeDotsLoader snippet
1 parent 7c0e0bf commit b91022a

File tree

1 file changed

+30
-41
lines changed

1 file changed

+30
-41
lines changed

components/Snippets/ThreeDotsLoader.js

+30-41
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,21 @@ const exampleWrapper = styled('div', {
7777

7878
const cssStyling = `
7979
.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;
80+
width: 14px;
81+
height: 14px;
82+
border-radius: 50%;
83+
background-color: white;
84+
animation: flashing 1.4s infinite linear;
85+
margin: 0 4px;
86+
display: inline-block;
8787
}
8888
8989
.exampleClass span:nth-child(2) {
90-
animation-delay: .2s;
90+
animation-delay: 0.2s;
9191
}
9292
9393
.exampleClass span:nth-child(3) {
94-
animation-delay: .4s;
94+
animation-delay: 0.4s;
9595
}
9696
9797
@keyframes flashing {
@@ -100,7 +100,7 @@ const cssStyling = `
100100
}
101101
20% {
102102
opacity: 1;
103-
},
103+
}
104104
100% {
105105
opacity: 0.2;
106106
}
@@ -109,45 +109,34 @@ const cssStyling = `
109109

110110
const scssStyling = `
111111
.exampleClass {
112-
position: relative;
113-
width: 14px;
114-
height: 14px;
115-
border-radius: 50%;
116-
background-color: white;
117-
color: white;
118-
animation: flashing 0.8s infinite linear alternate 0.4s;
119-
120-
&::before,
121-
&::after {
122-
content: '';
123-
display: inline-block;
124-
position: absolute;
125-
top: 0;
112+
span {
126113
width: 14px;
127114
height: 14px;
128115
border-radius: 50%;
129116
background-color: white;
130-
color: white;
131-
}
117+
animation: flashing 1.4s infinite linear;
118+
margin: 0 4px;
119+
display: inline-block;
132120
133-
&::before {
134-
left: -21px;
135-
animation: flashing 0.8s infinite alternate;
136-
}
121+
&:nth-child(2) {
122+
animation-delay: 0.2s;
123+
}
137124
138-
&::after {
139-
left: 21px;
140-
animation: flashing 0.8s infinite alternate 0.8s;
125+
&:nth-child(3) {
126+
animation-delay: 0.4s;
127+
}
141128
}
142-
}
143129
144-
@keyframes flashing {
145-
0% {
146-
background-color: white;
147-
}
148-
50%,
149-
100% {
150-
background-color: rgba(255, 255, 255, 0.3);
130+
@keyframes flashing {
131+
0% {
132+
opacity: 0.2;
133+
}
134+
20% {
135+
opacity: 1;
136+
}
137+
100% {
138+
opacity: 0.2;
139+
}
151140
}
152141
}
153142
`;

0 commit comments

Comments
 (0)