DaveKeehl / svelte-reveal

Svelte action that leverages the Intersection Observer API to trigger reveal on scroll transitions.
https://stackblitz.com/edit/svelte-reveal?file=src%2FApp.svelte
MIT License
131 stars 3 forks source link

[Bug]: Display block not compatible with CSS layouts #128

Closed nathancahill closed 2 years ago

nathancahill commented 2 years ago

Describe the bug

This commit (https://github.com/DaveKeehl/svelte-reveal/commit/18d0f6d58e0e912602326394ca4a939a0e3bcb89) adds extra CSS properties to the element. This breaks other CSS layouts if display is set to flex or grid etc.

The correct way to do this to let the user set display: block on the element if needed.

Reproduction

Any example shows the properties being applied.

System Info

Latest version, all browsers.

Severity

Serious, but I can work around it

Additional Information

Happy to submit a PR with a fix.

DaveKeehl commented 2 years ago

Hi, thanks for reaching out. Feel free to submit a PR. I'll take a look at it ASAP

DaveKeehl commented 2 years ago

I just released version 0.6.0 which solves your problem. Thanks for the feedback and suggestions! I've also updated the REPL example.