francoischalifour / medium-zoom

🔎🖼 A JavaScript library for zooming images like Medium
https://medium-zoom.francoischalifour.com
MIT License
3.58k stars 161 forks source link

fix: give zoom transition higher priority #148

Closed francoischalifour closed 4 years ago

francoischalifour commented 4 years ago

Description

This makes sure that the opening/closing transitions are triggered even though an image CSS transition is provided as inline style.

This is problematic with frameworks that generate inline styles on their images (e.g. Gatsby).

Closes #110.

Solution

The CSS transition is marked as "!important" for the animation to happen even though it's overridden by another inline transition style attribute.