Skip to content

Commit cf2b05a

Browse files
committed
respect starting opacities
1 parent 67a73cb commit cf2b05a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

transition.mjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,14 @@ export function crossfade({ fallback, ...defaults }) {
138138

139139
const style = getComputedStyle(node);
140140
const transform = style.transform === 'none' ? '' : style.transform;
141+
const opacity = +opacity;
141142

142143
return {
143144
delay,
144145
duration: is_function(duration) ? duration(d) : duration,
145146
easing,
146147
css: (t, u) => `
147-
opacity: ${t};
148+
opacity: ${t * opacity};
148149
transform: ${transform} translate(${u * dx}px,${u * dy}px);
149150
`
150151
};

0 commit comments

Comments
 (0)