Closed Nomango closed 7 months ago
This isn't a problem with Medium Zoom but rather with the Astro page transition lifecycle?
Astro documentation mentions that
The contents of the \<head> are swapped out inside the startViewTransition callback
and also
Module scripts are only ever executed once because the browser keeps track of which modules are already loaded. For these scripts, you do not need to worry about re-execution.
So that the injected css disappears after cleaning \<head> during page transition.
Should it be automatically re-injected?
I see. Ideally we would expose another JS bundle without injected styles, and another CSS dist file that you would import yourself. This way you've got better control on the styles.
Would you be interested in contributing to this?
Of course! But... my front-end skills are not good. Actually, I can only understand what you mean but have no idea about how to implement it. 😂 Sorry.
If you don't have much time on it, I am willing to give it a try, but it may take some time.
Bug description
medium-zoom
is not working after the page transition in Astro.The reason seems to be that
style
in header is gone after page transition.How to reproduce
mediumZoom
and navigate to any pageExpected behavior
mediumZoom
works normally.Reproducible example
Link to the bug reproduction
Environment
medium-zoom
version: 1.0.8