Skip to content

Commit

Permalink
fix(card): remove white space from bottom of card (#18328)
Browse files Browse the repository at this point in the history
When using a card with the button attribute the `<button>` element is
set to display: inline-block in chrome. This causes an undesirable line
of white space at the bottom of the card. This is most noticeable when
using an image inside the card where the bottom of the `<img>` tag won't
reach the bottom of the card.

Setting the button to have `display: block` ignores this white space
allowing the content to reach the end of the card.
  • Loading branch information
studioromeo authored and liamdebeasi committed May 29, 2019
1 parent 11cde99 commit d53e7aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/components/card/card.scss
Expand Up @@ -70,6 +70,8 @@
@include padding(0);
@include margin(0);

display: block;

width: 100%;
min-height: var(--min-height);

Expand Down Expand Up @@ -100,4 +102,4 @@ button, a {

ion-ripple-effect {
color: var(--ripple-color);
}
}
4 changes: 4 additions & 0 deletions core/src/components/card/test/button/index.html
Expand Up @@ -68,6 +68,10 @@
</ion-card-content>
</ion-card>

<ion-card button>
<img src="https://images.unsplash.com/photo-1483354483454-4cd359948304?dpr=1&auto=format&fit=crop&w=1000&q=80&cs=tinysrgb&ixid=dW5zcGxhc2guY29tOzs7Ozs%3D">
</ion-card>

</ion-content>

</ion-app>
Expand Down

0 comments on commit d53e7aa

Please sign in to comment.