1+ const LOCAL_REFERENCES = {
2+ "--animation-blink-@" : `0%, 100% { opacity: 1 }
3+ 50% { opacity: .5 }`
4+ } ;
5+
16export default {
27 "--animation-fade-in" : "fade-in .5s var(--ease-3)" ,
38 "--animation-fade-in-@" : `
@@ -39,51 +44,121 @@ export default {
3944 "--animation-scale-up-@" : `
4045@keyframes scale-up {
4146 to { transform: scale(1.25) }
47+ }` ,
48+ "--animation-scale-up-@media:reduced" : `
49+ @keyframes scale-up {
50+ 0% { opacity: 1; }
51+ 50% { opacity: 0; transform: scale(1); }
52+ 50.01% { transform: scale(1.25); }
53+ 100% { opacity: 1; transform: scale(1.25); }
4254}` ,
4355 "--animation-scale-down" : "scale-down .5s var(--ease-3)" ,
4456 "--animation-scale-down-@" : `
4557@keyframes scale-down {
4658 to { transform: scale(.75) }
59+ }` ,
60+ "--animation-scale-down-@media:reduced" : `
61+ @keyframes scale-down {
62+ 0% { opacity: 1; }
63+ 50% { opacity: 0; transform: scale(1); }
64+ 50.01% { transform: scale(.75); }
65+ 100% { opacity: 1; transform: scale(.75); }
4766}` ,
4867 "--animation-slide-out-up" : "slide-out-up .5s var(--ease-3)" ,
4968 "--animation-slide-out-up-@" : `
5069@keyframes slide-out-up {
5170 to { transform: translateY(-100%) }
71+ }` ,
72+ "--animation-slide-out-up-@media:reduced" : `
73+ @keyframes slide-out-up {
74+ 0% { opacity: 1; }
75+ 50% { opacity: 0; transform: translateY(0%); }
76+ 50.01% { transform: translateY(-100%); }
77+ 100% { opacity: 1; transform: translateY(-100%); }
5278}` ,
5379 "--animation-slide-out-down" : "slide-out-down .5s var(--ease-3)" ,
5480 "--animation-slide-out-down-@" : `
5581@keyframes slide-out-down {
5682 to { transform: translateY(100%) }
83+ }` ,
84+ "--animation-slide-out-down-@media:reduced" : `
85+ @keyframes slide-out-down {
86+ 0% { opacity: 1; }
87+ 50% { opacity: 0; transform: translateY(0%); }
88+ 50.01% { transform: translateY(100%); }
89+ 100% { opacity: 1; transform: translateY(100%); }
5790}` ,
5891 "--animation-slide-out-right" : "slide-out-right .5s var(--ease-3)" ,
5992 "--animation-slide-out-right-@" : `
6093@keyframes slide-out-right {
6194 to { transform: translateX(100%) }
95+ }` ,
96+ "--animation-slide-out-right-@media:reduced" : `
97+ @keyframes slide-out-right {
98+ 0% { opacity: 1; }
99+ 50% { opacity: 0; transform: translateX(0%); }
100+ 50.01% { transform: translateX(100%); }
101+ 100% { opacity: 1; transform: translateX(100%); }
62102}` ,
63103 "--animation-slide-out-left" : "slide-out-left .5s var(--ease-3)" ,
64104 "--animation-slide-out-left-@" : `
65105@keyframes slide-out-left {
66106 to { transform: translateX(-100%) }
107+ }` ,
108+ "--animation-slide-out-left-@media:reduced" : `
109+ @keyframes slide-out-left {
110+ 0% { opacity: 1; }
111+ 50% { opacity: 0; transform: translateX(0%); }
112+ 50.01% { transform: translateX(-100%); }
113+ 100% { opacity: 1; transform: translateX(-100%); }
67114}` ,
68115 "--animation-slide-in-up" : "slide-in-up .5s var(--ease-3)" ,
69116 "--animation-slide-in-up-@" : `
70117@keyframes slide-in-up {
71118 from { transform: translateY(100%) }
119+ }` ,
120+ "--animation-slide-in-up-@media:reduced" : `
121+ @keyframes slide-in-up {
122+ 0% { opacity: 1; transform: translateY(100%); }
123+ 50% { opacity: 0; transform: translateY(100%); }
124+ 50.01% { transform: translateY(0%); }
125+ 100% { opacity: 1; transform: translateY(0%); }
72126}` ,
73127 "--animation-slide-in-down" : "slide-in-down .5s var(--ease-3)" ,
74128 "--animation-slide-in-down-@" : `
75129@keyframes slide-in-down {
76130 from { transform: translateY(-100%) }
131+ }` ,
132+ "--animation-slide-in-down-@media:reduced" : `
133+ @keyframes slide-in-down {
134+ 0% { opacity: 1; transform: translateY(-100%); }
135+ 50% { opacity: 0; transform: translateY(-100%); }
136+ 50.01% { transform: translateY(0%); }
137+ 100% { opacity: 1; transform: translateY(0%); }
77138}` ,
78139 "--animation-slide-in-right" : "slide-in-right .5s var(--ease-3)" ,
79140 "--animation-slide-in-right-@" : `
80141@keyframes slide-in-right {
81142 from { transform: translateX(-100%) }
143+ }` ,
144+ "--animation-slide-in-right-@media:reduced" : `
145+ @keyframes slide-in-right {
146+ 0% { opacity: 1; transform: translateX(-100%); }
147+ 50% { opacity: 0; transform: translateX(-100%); }
148+ 50.01% { transform: translateX(0%); }
149+ 100% { opacity: 1; transform: translateX(0%); }
82150}` ,
83151 "--animation-slide-in-left" : "slide-in-left .5s var(--ease-3)" ,
84152 "--animation-slide-in-left-@" : `
85153@keyframes slide-in-left {
86154 from { transform: translateX(100%) }
155+ }` ,
156+ "--animation-slide-in-left-@media:reduced" : `
157+ @keyframes slide-in-left {
158+ 0% { opacity: 1; transform: translateX(100%); }
159+ 50% { opacity: 0; transform: translateX(100%); }
160+ 50.01% { transform: translateX(0%); }
161+ 100% { opacity: 1; transform: translateX(0%); }
87162}` ,
88163 "--animation-shake-x" : "shake-x .75s var(--ease-out-5)" ,
89164 "--animation-shake-x-@" : `
@@ -93,6 +168,10 @@ export default {
93168 40% { transform: translateX(5%) }
94169 60% { transform: translateX(-5%) }
95170 80% { transform: translateX(5%) }
171+ }` ,
172+ "--animation-shake-x-@media:reduced" : `
173+ @keyframes shake-x {
174+ ${ LOCAL_REFERENCES [ '--animation-blink-@' ] }
96175}` ,
97176 "--animation-shake-y" : "shake-y .75s var(--ease-out-5)" ,
98177 "--animation-shake-y-@" : `
@@ -102,11 +181,19 @@ export default {
102181 40% { transform: translateY(5%) }
103182 60% { transform: translateY(-5%) }
104183 80% { transform: translateY(5%) }
184+ }` ,
185+ "--animation-shake-y-@media:reduced" : `
186+ @keyframes shake-y {
187+ ${ LOCAL_REFERENCES [ '--animation-blink-@' ] }
105188}` ,
106189 "--animation-spin" : "spin 2s linear infinite" ,
107190 "--animation-spin-@" : `
108191@keyframes spin {
109192 to { transform: rotate(1turn) }
193+ }` ,
194+ "--animation-spin-@media:reduced" : `
195+ @keyframes spin {
196+ ${ LOCAL_REFERENCES [ '--animation-blink-@' ] }
110197}` ,
111198 "--animation-ping" : "ping 5s var(--ease-out-3) infinite" ,
112199 "--animation-ping-@" : `
@@ -116,31 +203,42 @@ export default {
116203 opacity: 0;
117204 }
118205}` ,
119- "--animation-blink" : "blink 1s var(--ease-out-3) infinite" ,
120- "--animation-blink-@" : `
121- @keyframes blink {
122- 0%, 100% {
123- opacity: 1
124- }
125- 50% {
126- opacity: .5
127- }
206+ "--animation-ping-@media:reduced" : `
207+ @keyframes ping {
208+ ${ LOCAL_REFERENCES [ '--animation-blink-@' ] }
128209}` ,
210+ "--animation-blink" : "blink 1s var(--ease-out-3) infinite" ,
211+ "--animation-blink-@" : `
212+ @keyframes blink {
213+ ${ LOCAL_REFERENCES [ '--animation-blink-@' ] }
214+ }` ,
129215 "--animation-float" : "float 3s var(--ease-in-out-3) infinite" ,
130216 "--animation-float-@" : `
131217@keyframes float {
132218 50% { transform: translateY(-25%) }
219+ }` ,
220+ "--animation-float-@media:reduced" : `
221+ @keyframes float {
222+ ${ LOCAL_REFERENCES [ '--animation-blink-@' ] }
133223}` ,
134224 "--animation-bounce" : "bounce 2s var(--ease-squish-2) infinite" ,
135225 "--animation-bounce-@" : `
136226@keyframes bounce {
137227 25% { transform: translateY(-20%) }
138228 40% { transform: translateY(-3%) }
139229 0%, 60%, 100% { transform: translateY(0) }
230+ }` ,
231+ "--animation-bounce-@media:reduced" : `
232+ @keyframes bounce {
233+ ${ LOCAL_REFERENCES [ '--animation-blink-@' ] }
140234}` ,
141235 "--animation-pulse" : "pulse 2s var(--ease-out-3) infinite" ,
142236 "--animation-pulse-@" : `
143237@keyframes pulse {
144238 50% { transform: scale(.9,.9) }
145239}` ,
240+ "--animation-pulse-@media:reduced" : `
241+ @keyframes pulse {
242+ ${ LOCAL_REFERENCES [ '--animation-blink-@' ] }
243+ }` ,
146244}
0 commit comments