Skip to content
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

fix(list): align avatar size in dense list with spec #10028

Merged
merged 1 commit into from
Feb 26, 2018

Conversation

crisbeto
Copy link
Member

  • Fixes the dense list avatar being slightly larger than the spec.
  • Removes an unnecessary setter from the MatListItem class.

Fixes #10019.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Feb 19, 2018
@@ -69,7 +70,7 @@ $mat-list-item-inset-divider-offset: 72px;
}

&.mat-list-item-avatar {
height: $avatar-height;
height: $has-avatar-height;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why has this been called $has-avatar-height?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the old name wasn't totally accurate. It wasn't "height of the avatar", but more like "height when the item has an avatar".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see. It's just pretty confusing that the class is called mat-list-item-avatar. Should be in my opinion something like: mat-list-item-with-avatar. Also $has-avatar-height isn't really any more clear, just more explicit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I agree. I avoided renaming it in order to avoid breaking changes where people might be using a querySelector on it or are overriding the styling.

Copy link
Member

@devversion devversion Feb 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we can keep it like that to avoid breaking changes. If you want, having a comment on the class would be still somehow nice IMO

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decided to keep the old class with a deletion target and to add mat-list-item-with-avatar.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


$mat-list-item-inset-divider-offset: 72px;

// This mixin provides all list-item styles, changing font size and height
// based on whether the list is in dense mode.
@mixin mat-list-item-base($base-height, $avatar-height, $two-line-height,
$three-line-height, $multi-line-padding, $icon-size) {
@mixin mat-list-item-base($base-height, $has-avatar-height, $two-line-height,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$height-with-avatar?

@jelbourn jelbourn added the action: merge The PR is ready for merge by the caretaker label Feb 20, 2018
@crisbeto crisbeto force-pushed the 10019/dense-list-avatar-size branch from 40c7657 to 0fa296b Compare February 20, 2018 17:32
@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Feb 20, 2018
* Fixes the dense list avatar being slightly larger than the spec.
* Removes an unnecessary setter from the `MatListItem` class.

Fixes angular#10019.
@crisbeto crisbeto force-pushed the 10019/dense-list-avatar-size branch from 0fa296b to 9abd74f Compare February 20, 2018 17:33
@jelbourn jelbourn merged commit d4a4f61 into angular:master Feb 26, 2018
mmalerba pushed a commit to mmalerba/components that referenced this pull request Feb 26, 2018
* Fixes the dense list avatar being slightly larger than the spec.
* Removes an unnecessary setter from the `MatListItem` class.

Fixes angular#10019.
jelbourn pushed a commit to jelbourn/components that referenced this pull request Feb 27, 2018
* Fixes the dense list avatar being slightly larger than the spec.
* Removes an unnecessary setter from the `MatListItem` class.

Fixes angular#10019.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dense lists avatar size doesn't follow the guidelines
4 participants