-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix border card hover safari #1140
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find! I think we just need to fiddle with it a little more to ensure we don't cause shadow overlaps. Hopefully it's straightforward adjustment.
I have opted to fix this with Another solution for Safari seems to be to apply:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! glad the z-index fix could still work out. Tested the fix in safari and looked for shadow/z-related regressions and didn't notice any issues.
@@ -37,6 +37,7 @@ | |||
|
|||
.card .card__inner .card__media { | |||
overflow: hidden; | |||
z-index: 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we try to avoid comments in code, but I'm tempted to include a short one on this line that makes it known it's needed for a safari bug. I could see it appearing as though it's not doing anything and getting removed in the future. Not sure how everyone feels about that..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be a good idea - CSS isn't very self-explanatory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figure if it was a cross-browser bug or even a chrome bug it'd be fine, but I think it'll get overlooked in safari, especially being an on-hover issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved - Maybe add a comment like Ken mentioned.
47e6815
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these changes introduced?
Fixes #1121 .
What approach did you take?
Updated the z-index for the card and the media. The reason this was happening is because when we apply
transform
oropacity
(which we are for the animation), the order doesn't stay the same even withposition: relative
. So the solution is to set the index. More here: https://coder-coder.com/z-index-isnt-working/Other considerations
Demo links
Test on safari:
Checklist