-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
[Card] Extra margins show when using ripple #10898
Comments
Same for |
@andrewseguin I tried looking into the issue but couldn't find anything that allows us to skip Technically the ripple elements are valid children that can be also the last element. If we try something like: I also tried to select the element before the first Just wanted to summarize my findings real quick. Maybe someone does have some other ideas. I will keep looking into it. |
Problem not resolve |
Please take a look at this thread: #14981 - @devversion explanation is clear, To fix the problem, add this code to your global CSS file:
|
Work around doesn't work |
Stumbled on this issue as well. After some inspection, it seems adding and empty (or not empty) https://stackblitz.com/edit/angular-material2-card-ripple-adgv8u |
The bug appears not only on the A possible workaround is to add the margin to the last element on its own, if design allows it. Or wrap container to other and set In this particular topic starter case, the workaround may look like:
More details here: https://stackblitz.com/edit/angular-material2-matripple-i5ugtwissie?file=app/app.component.html |
I wonder if a ripple solution that uses CSS paint worklet could avoid this issue. |
The ripple implementation we currently provide, relies on actual HTML elements being added to the DOM. This could indeed be an issue for any container that relies on order (e.g. through CSS We are working on MDC components that might also involve a new implementation of ripples. At time of writing, MDC uses pseudo elements for those. That might fix this issue, but could cause other issues due to conflicting pseudo elements. I don't believe there is a good ripple solution that works in all cases though. |
I´m some time ago, do this:
Adding a div inside a mat-card element this problem was fixed but after an update to v9 of angular framework, doesn´t work.
But this, delete a ripple effect, so as well im tryed replace display: none; by padding/margin: 0 !important; and doesn´t work... Somebody have another workaround solution? **UPDATE: ** Same problem occurs at mat-slide-toggle inside container with display flex <- A solution for this, can be:
This not affect at functionality or effect of mat-slide-toggle |
Confirming that this is still an issue with the MDC-based card: The issue is still the |
I faced the same issue. I managed to avoid it by using an empty mat-card-footer . In this case :last-child won't be applied |
Temporary workaround is to add a |
|
When
matRipple
is added to a<mat-card>
, the card expands on click.Reproduction: https://stackblitz.com/edit/angular-1mherw?file=app/card-overview-example.html
This is due to the styling rule that says every element in the card except for the last should have bottom margin. When the ripple is added, the last element is no longer last and so it gains the margin bottom.
https://github.com/angular/material2/blob/master/src/lib/card/card.scss#L190
The text was updated successfully, but these errors were encountered: