-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix(list): align avatar size in dense list with spec #10028
Conversation
src/lib/list/list.scss
Outdated
@@ -69,7 +70,7 @@ $mat-list-item-inset-divider-offset: 72px; | |||
} | |||
|
|||
&.mat-list-item-avatar { | |||
height: $avatar-height; | |||
height: $has-avatar-height; |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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".
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/lib/list/list.scss
Outdated
|
||
$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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$height-with-avatar
?
40c7657
to
0fa296b
Compare
* Fixes the dense list avatar being slightly larger than the spec. * Removes an unnecessary setter from the `MatListItem` class. Fixes angular#10019.
0fa296b
to
9abd74f
Compare
* Fixes the dense list avatar being slightly larger than the spec. * Removes an unnecessary setter from the `MatListItem` class. Fixes angular#10019.
* Fixes the dense list avatar being slightly larger than the spec. * Removes an unnecessary setter from the `MatListItem` class. Fixes angular#10019.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
MatListItem
class.Fixes #10019.