Closed plasmatech8 closed 1 year ago
Hey @plasmatech8
Thanks for creating this issue,
transition: 0.2s
which converts to transition: all 0.2s
automatically.ripple-effect
class to the element where there is use:ripple
? If that button rerenders immediately after clicking, It may remove the class I guess. If not, might be a Safari bug because I wasn't able to reproduce it on another browser.Changing the default ripple color to transparent currentColor (based on text color).
That's a great suggestion. Will add it.
Small linting issues like "use const instead of let" and add / eslint-disable @typescript-eslint/no-explicit-any / to allow any types.
Will do.
Thanks @Posandu.
Removing the Skeleton class .btn
from my button fixes the overflow issue for me. :O
However, I don't know what exactly is causing the problem. I assumed that it was related to Safari not handling overflow + border radius properly as mentioned in the StackOverflow answer and also in a Apple forum.
...for my app anyways, I will stick to -webkit-transform
as a quick fix.
.btn
class... Edit:
Actually, this might be the problem.
Overriding this CSS variable causes the overflow issue for some reason...
--tw-brightness: brightness(1) !important;
That's some interesting behavior because --tw-brightness
has nothing to do with this library. 😅 Is this occurring only on Safari?
Yeah, only on Safari. Not Firefox or Chrome. Seems strange - I guess it must be relate to how Safari handles filters with overflow?..
Also, in your https://github.com/plasmatech8/skeleton-material-theme library, It seems that the ripple is shifted to the right of the clicking position a bit. Did you change some other code? Because I'm not sure whether it's an issue with this library or with your library.
Edit: seems like this is causing the issue. Not a problem with this library.
.btn>:not([hidden])~:not([hidden]) {
--tw-space-x-reverse: 0;
margin-right:calc(.5rem * var(--tw-space-x-reverse));
margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))
}
Thanks! Good spotting, lol. I did not even realize that the position was offset slightly. I'll have to take a look tomorrow.
Hi,
Thanks for making this package.
1. Ripple Effect Disappearing Problem on Chromium
On Chromium (on my MacOS + Android device), the ripple effect breaks/disappears due to CSS transition statement not working with opacity.
See the video below:
https://github.com/Posandu/svelte-ripple-action/assets/40431112/375a0112-8f05-42bc-92d7-787783059723
This appears to be due to Chromium browsers not recognizing the transition CSS for opacity.
That is, this does not work:
Instead you need to use:
2. Ripple Effect Overflow Problem on Webkit
On Webkit/Safari (MacOS), the
overflow: hidden
does not work properly once the ripple expands to full size.See the video below:
https://github.com/Posandu/svelte-ripple-action/assets/40431112/b5455752-e678-44b0-b022-06a7591deaea
I don't know why this is happening. Maybe it is just Safari being Safari.
This can be fixed by adding:
Which is solution from: https://stackoverflow.com/a/16681137
Example
I have been using this package for my attempt to make a Material-like theme for Skeleton UI. Which requires a material ripple.
(https://github.com/plasmatech8/skeleton-material-theme)
I have copied this library into the src/lib/svalte-ripple-action subfolder of this repository with the modification mentioned above - and I can confirm that it works after the change.
Other Comments
Also, while I am here, here are some minor suggestions:
const
instead oflet
" and add/* eslint-disable @typescript-eslint/no-explicit-any */
to allowany
types.