angular / angular/components

[Card] Extra margins show when using ripple

Open
#10,898 14 comments 8 reactions 0 assignees View on GitHub
area: material/card area: material/core P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

When `matRipple` is added to a ``, 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

Contributor guide

Open the contributing guide

Research direction

Start with the styling rule near src/lib/card/card.scss#L190 and use the linked StackBlitz reproduction to observe the card expansion when matRipple is added to mat-card. The fix is done when the card no longer gains an extra bottom margin or expands on click while retaining the existing card spacing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.