Flickering/disappearing items in Safari with Tailwind CSS hover effects in masonry layout
What version of Tailwind CSS are you using?
v3.4.1
What build tool (or framework if it abstracts the build tool) are you using?
Next.js 14.2.14 (15.0.2 as well), with Tailwind CSS integrated via PostCSS configuration.
What version of Node.js are you using?
v22.9.0
What browser are you using?
Safari (the issue is not present in Chrome)
What operating system are you using?
macOS, IOS
Reproduction URL
-
Cards with content: https://www.dkoval.pro/projects
Code:
- https://github.com/dmk/dkoval.pro/blob/main/src/components/Projects/ProjectList.tsx
- https://github.com/dmk/dkoval.pro/blob/main/src/components/Projects/ProjectCard.tsx
-
Images: https://www.dkoval.pro/cats
Code:
- https://github.com/dmk/dkoval.pro/blob/main/src/components/CatGallery/PhotoGallery.tsx
- https://github.com/dmk/dkoval.pro/blob/main/src/components/CatGallery/PhotoCard.tsx
Describe your issue
When hovering over the items in a Tailwind CSS-based masonry grid layout in Safari, elements in the top row, except for the first (leftmost) item, flicker or disappear momentarily. This issue affects cards with images as well as other non-image cards. The hover effect utilizes hover:shadow-2xl, hover:scale-105, transform, and transition-all classes on each item.
It appears that the bottom of the last element in one column is somehow overlapping onto the top of the element in the next column.