Background: In plain CSS, transition-property and transition-timing-function are interdependent.
.myClass {
transition-property: 'property-1, property2, property-3';
transition-timing-function: 'function-1, function-2, function3';
}
function-1 applies to property-1, function-2 to property-2, function-3 to property-3.
This is interdependence is not respected by inline-style-prefixer.
Consider the following code:
import Prefixer from 'inline-style-prefixer'
const originalStyle = {
transitionProperty: 'transform, opacity',
transitionTimingFunction: 'ease, step-end'
}
const prefixer = new Prefixer()
const prefixedStyle = prefixer.prefix(originalStyle)
console.log(prefixedStyle);
Expectation: ease applies to the transform transition, step-end applies to opacity
Reality: In this above block of code, the stdout is
{
transitionProperty: '-webkit-transform, transform, opacity',
transitionTimingFunction: 'ease, step-end',
WebkitTransitionProperty: '-webkit-transform, transform, opacity',
MozTransitionProperty: 'transform, opacity'
}
In particular, notice that transitionProperty now has three list items, but transitionTimingFunction still has two.
If we applied this style object to a DOM node, ease would apply to -webkit-transform, step-end to transform, and no timing function would be applied to opacity.
This bug was surfaced in necolas/react-native-web#852
Background: In plain CSS,
transition-propertyandtransition-timing-functionare interdependent.function-1applies toproperty-1,function-2toproperty-2,function-3toproperty-3.This is interdependence is not respected by
inline-style-prefixer.Consider the following code:
Expectation:
easeapplies to thetransformtransition,step-endapplies toopacityReality: In this above block of code, the stdout is
In particular, notice that
transitionPropertynow has three list items, buttransitionTimingFunctionstill has two.If we applied this style object to a DOM node,
easewould apply to-webkit-transform,step-endtotransform, and no timing function would be applied toopacity.This bug was surfaced in necolas/react-native-web#852