-
Notifications
You must be signed in to change notification settings - Fork 24
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: ios button card style issue #2302
Conversation
Visual Test Summary Largest Differences Download Link Run Details |
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 catch! And yeah super frustrating indeed, particularly given how different browsers handle these differently
PR Checklist
Description
Fixes an issue where the background of the button component with
variant: card
applied would turn transparent when scrolled off screen and back again.This is a frustratingly simple solution to an issue that cause some headaches: the card variant of the button component had an extra drop-shadow filter applied, in addition to the
box-shadow
applied to the ionic button component. Removing this additional drop-shadow fixes the issue.Dev notes
Before I removed this filter, the behaviour was very strange (I've added some brief notes to #2287 in case they're useful in future). I think there is possibly a genuine bug that could be reported to ionic (or even Apple), along the lines of "Setting both a CSS drop-shadow filter and a box-shadow on an element causes CSS variables to not be passed correctly to children", but I don't think I've managed to isolate the bug fully. And this is a pattern we can easily avoid.
Git Issues
Closes #2287
Screenshots/Videos
I've made a new template, debug_card_styles, for visually comparing all the components that have are styled as a "card". The fact that we have different components that look so similar is confusing, but I think still justified as they are functionally fundamentally different (a
task-card
necessarily has an associated task or task group, which has a completion status, whereas a button has no such association). Comparing these elements before and after the changes made by this PR, we can see that in the "before", the button withvariant: card
stands out as having a darker shadow than the other elements. In the "after" the drop-shadows for all elements match. I don't think there is any reason for this other than an error made when duplicating some CSS code (thecard-portrait
variant of the button does not use anion-button
as its base, so deliberately has this filter applied).Working demo
Demo of comp_button component showing bug not present (see this comment on the issue for previous behaviour).
button.fixed.mov