Skip to content

Commit 77ccb5c

Browse files
committed
Rename motion-reduced to motion-reduce
1 parent 8b08814 commit 77ccb5c

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

__tests__/variantsAtRule.test.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ test('it can generate focus-visible variants', () => {
177177
})
178178
})
179179

180-
test('it can generate motion-reduced variants', () => {
180+
test('it can generate motion-reduce variants', () => {
181181
const input = `
182-
@variants motion-reduced {
182+
@variants motion-reduce {
183183
.banana { color: yellow; }
184184
.chocolate { color: brown; }
185185
}
@@ -189,8 +189,8 @@ test('it can generate motion-reduced variants', () => {
189189
.banana { color: yellow; }
190190
.chocolate { color: brown; }
191191
@media (prefers-reduced-motion: reduce) {
192-
.motion-reduced\\:banana { color: yellow; }
193-
.motion-reduced\\:chocolate { color: brown; }
192+
.motion-reduce\\:banana { color: yellow; }
193+
.motion-reduce\\:chocolate { color: brown; }
194194
}
195195
`
196196

@@ -223,9 +223,9 @@ test('it can generate motion-safe variants', () => {
223223
})
224224
})
225225

226-
test('it can generate motion-safe and motion-reduced variants', () => {
226+
test('it can generate motion-safe and motion-reduce variants', () => {
227227
const input = `
228-
@variants motion-safe, motion-reduced {
228+
@variants motion-safe, motion-reduce {
229229
.banana { color: yellow; }
230230
.chocolate { color: brown; }
231231
}
@@ -239,8 +239,8 @@ test('it can generate motion-safe and motion-reduced variants', () => {
239239
.motion-safe\\:chocolate { color: brown; }
240240
}
241241
@media (prefers-reduced-motion: reduce) {
242-
.motion-reduced\\:banana { color: yellow; }
243-
.motion-reduced\\:chocolate { color: brown; }
242+
.motion-reduce\\:banana { color: yellow; }
243+
.motion-reduce\\:chocolate { color: brown; }
244244
}
245245
`
246246

@@ -250,9 +250,9 @@ test('it can generate motion-safe and motion-reduced variants', () => {
250250
})
251251
})
252252

253-
test('motion-reduced variants stack with basic variants', () => {
253+
test('motion-reduce variants stack with basic variants', () => {
254254
const input = `
255-
@variants motion-reduced, hover {
255+
@variants motion-reduce, hover {
256256
.banana { color: yellow; }
257257
.chocolate { color: brown; }
258258
}
@@ -264,10 +264,10 @@ test('motion-reduced variants stack with basic variants', () => {
264264
.hover\\:banana:hover { color: yellow; }
265265
.hover\\:chocolate:hover { color: brown; }
266266
@media (prefers-reduced-motion: reduce) {
267-
.motion-reduced\\:banana { color: yellow; }
268-
.motion-reduced\\:chocolate { color: brown; }
269-
.motion-reduced\\:hover\\:banana:hover { color: yellow; }
270-
.motion-reduced\\:hover\\:chocolate:hover { color: brown; }
267+
.motion-reduce\\:banana { color: yellow; }
268+
.motion-reduce\\:chocolate { color: brown; }
269+
.motion-reduce\\:hover\\:banana:hover { color: yellow; }
270+
.motion-reduce\\:hover\\:chocolate:hover { color: brown; }
271271
}
272272
`
273273

@@ -304,9 +304,9 @@ test('motion-safe variants stack with basic variants', () => {
304304
})
305305
})
306306

307-
test('motion-safe and motion-reduced variants stack with basic variants', () => {
307+
test('motion-safe and motion-reduce variants stack with basic variants', () => {
308308
const input = `
309-
@variants motion-reduced, motion-safe, hover {
309+
@variants motion-reduce, motion-safe, hover {
310310
.banana { color: yellow; }
311311
.chocolate { color: brown; }
312312
}
@@ -318,10 +318,10 @@ test('motion-safe and motion-reduced variants stack with basic variants', () =>
318318
.hover\\:banana:hover { color: yellow; }
319319
.hover\\:chocolate:hover { color: brown; }
320320
@media (prefers-reduced-motion: reduce) {
321-
.motion-reduced\\:banana { color: yellow; }
322-
.motion-reduced\\:chocolate { color: brown; }
323-
.motion-reduced\\:hover\\:banana:hover { color: yellow; }
324-
.motion-reduced\\:hover\\:chocolate:hover { color: brown; }
321+
.motion-reduce\\:banana { color: yellow; }
322+
.motion-reduce\\:chocolate { color: brown; }
323+
.motion-reduce\\:hover\\:banana:hover { color: yellow; }
324+
.motion-reduce\\:hover\\:chocolate:hover { color: brown; }
325325
}
326326
@media (prefers-reduced-motion: no-preference) {
327327
.motion-safe\\:banana { color: yellow; }

src/lib/substituteVariantsAtRules.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ const defaultVariantGenerators = config => ({
3838
mediaQuery.append(modified)
3939
container.append(mediaQuery)
4040
}),
41-
'motion-reduced': generateVariantFunction(({ container, separator, modifySelectors }) => {
41+
'motion-reduce': generateVariantFunction(({ container, separator, modifySelectors }) => {
4242
const modified = modifySelectors(({ selector }) => {
4343
return selectorParser(selectors => {
4444
selectors.walkClasses(sel => {
45-
sel.value = `motion-reduced${separator}${sel.value}`
45+
sel.value = `motion-reduce${separator}${sel.value}`
4646
})
4747
}).processSync(selector)
4848
})
@@ -91,7 +91,7 @@ const defaultVariantGenerators = config => ({
9191
})
9292

9393
function prependStackableVariants(atRule, variants) {
94-
const stackableVariants = ['motion-safe', 'motion-reduced']
94+
const stackableVariants = ['motion-safe', 'motion-reduce']
9595

9696
if (!_.some(variants, v => stackableVariants.includes(v))) {
9797
return variants

0 commit comments

Comments
 (0)