question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Right margin for ion-avatar in ion-item not in line with material design guidelines

See original GitHub issue

Bug Report

Ionic version:

[x] 4.x

Current behavior:

Right margin for ion-avatar with slot=“start” in ion-item has right margin = 32px Expected behavior:

Right margin should be 16px according to material design https://material.io/design/components/lists.html#specs

Steps to reproduce:

Example in ionic4 documentation shows the issue: https://beta.ionicframework.com/docs/components#list (Look at PREVIEW not ios example) Related code: (From ionic4 docs)

<ion-list>
  <ion-item>
    <ion-avatar slot="start">
      <img src="/docs/assets/img/avatar-finn.png"></img>
    </ion-avatar>
    <ion-label>
      <h2>Finn</h2>
      <h3>I'm a big deal</h3>
      <p>Listen, I've had a pretty messed up day...</p>
    </ion-label>
  </ion-item>
</ion-list>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
brandyscarneycommented, Jan 8, 2019

Thanks for the issue! It seems the correct margin is applied to avatar, but it’s being overridden by this rule:

::slotted(:not(.interactive)[slot="start"]) {
  @include margin-horizontal($item-md-start-slot-margin-start, $item-md-start-slot-margin-end);
}

https://github.com/ionic-team/ionic/blob/master/core/src/components/item/item.md.scss#L89

screen shot 2019-01-08 at 11 04 40 am
0reactions
ionitron-bot[bot]commented, Feb 21, 2019

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Right margin for ion-avatar in ion-item not in line with ...
Right margin for ion-avatar in ion-item not in line with material design ... Right margin should be 16px according to material design
Read more >
ion-item: Input, Edit, or Delete iOS and Android Item Elements
Items show an inset bottom border by default. The border has padding on the left and does not appear under any content that...
Read more >
ion-avatar: Circular Application Avatar Icon Component
Ion -avatars are circular application components that wrap an image or icon. They can represent a person or an object, by themselves or...
Read more >
ion-input: Custom Input Value Type Styling and CSS ...
Material Design offers filled styles for an input when it is inside of an item. The fill property on the item can be...
Read more >
ion-menu
ion -menu components are navigation drawers that slide in from the side of the current view. Read our framework docs for the available...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found