material icon indicating copy to clipboard operation
material copied to clipboard

Card avatar alignment incorrect in Safari

Open gseabrook opened this issue 10 years ago • 4 comments

When using an avatar in the heading of an md-card, the svg does not align to the middle of the icon, and so the border looks incorrect

This can be seen by viewing the Angular Material docs in safari and looking at the page for 'Card'.

Material version - 1.1.0-RC5 Safari version - 9.1 (11601.5.17.1)

screen shot 2016-07-27 at 11 48 22

gseabrook avatar Jul 27 '16 03:07 gseabrook

I solved this issue with a CSS Rule

md-card-avatar > md-icon { height: auto; }

BenjaminHofstetter avatar Aug 03 '16 07:08 BenjaminHofstetter

md-card-avatar > md-icon { height: auto; } solves Safari but breaks IE. This is not a viable solution.

BenjaminHofstetter avatar Aug 03 '16 11:08 BenjaminHofstetter

md-icon { min-height: initial !important }

Works with IE, Safari, and Firefox

BenjaminHofstetter avatar Aug 09 '16 12:08 BenjaminHofstetter

Different browsers handle SVG height and width properties differently. It might be better to explicit set the SVG to use the md-icon height and width:

md-icon > svg {
  height: inherit;
  width: inherit;
}

I'm not sure why Safari would have this issue on md-card-avatar, but not elsewhere. It might be related to flexbox.

clshortfuse avatar Sep 06 '16 17:09 clshortfuse