Repository navigation
fix(divider): add inset styles for icons and lists in cards - #9242
Conversation
| // size of the parent class (e.g. avatar vs icon) | ||
| @mixin mat-inset-divider-offset($offset) { | ||
| $mat-list-item-inset-divider-offset: #{(2 * $mat-list-side-padding) + $offset}; | ||
| left: $mat-list-item-inset-divider-offset; |
There was a problem hiding this comment.
Why is this one using left/right, whereas the default divider styles are using margin-left/margin-right?
There was a problem hiding this comment.
Changed, the reason was that it was legacy from AngularJS Material
| $mat-list-item-inset-divider-offset: 72px; | ||
| // This mixin provides the correct offset for an inset divider based on the | ||
| // size of the parent class (e.g. avatar vs icon) | ||
| @mixin mat-inset-divider-offset($offset) { |
There was a problem hiding this comment.
The mixin should live somewhere in the divider module since it could be used in other modules that consume it.
| $mat-dense-multi-line-padding: 16px; | ||
| $mat-dense-list-icon-size: 20px; | ||
|
|
||
| $mat-list-item-inset-divider-offset: 72px; |
There was a problem hiding this comment.
Removing this is a breaking change, even though it isn't being used anywhere.
There was a problem hiding this comment.
Since mat-divider hasn't been merged into the minor version yet, can we still remove it? Happy to keep it as a placeholder otherwise
There was a problem hiding this comment.
It could still be used from when the divider was in the list module.
| left: auto; | ||
| right: $mat-list-item-inset-divider-offset; | ||
| } | ||
| position: absolute; |
There was a problem hiding this comment.
The position: absolute is defined in the parent rule above, you don't have to add it to .mat-divider-inset. Also the nesting here isn't necessary.
There was a problem hiding this comment.
It was present to override a similar position: static in the mat-card styles. I added an !important tag instead with a note for why it's there. I can add the nested structure back if you prefer to not have !important
There was a problem hiding this comment.
In that case it can at least use a comment about why the nesting was necessary.
| $mat-dense-multi-line-padding: 16px; | ||
| $mat-dense-list-icon-size: 20px; | ||
|
|
||
| $mat-list-item-inset-divider-offset: 72px; |
There was a problem hiding this comment.
It could still be used from when the divider was in the list module.
|
|
||
| .mat-divider { | ||
| position: absolute; | ||
| position: absolute !important; // this is done to override card inset styles |
There was a problem hiding this comment.
Rather than using !important, perhaps the selector can be made more specific or the card one can be less specific?
There was a problem hiding this comment.
The original nesting was the way to make it more specific. I don't think that modifying the card styles will be as elegant. I'll add back the nesting for now unless you have an alternative suggestion
b6536fc to
2f35ebe
Compare
|
@crisbeto I'm not entirely sure why the Bazel build is failing on Circle CI (I know it's because it doesn't like how I'm including the divider style file). Do you know what's going on? |
|
I'm not too sure about that error @CaerusKaru, my guess is that you'd need to add another item to the |
1401968 to
b864c92
Compare
|
@crisbeto I fixed the Bazel issues and rebased with master. Ready for review again. |
* Add mixin to dynamically apply inset divider offset based on the precursor in the list item * Add inset divider example using icons as precursor
|
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. |
the precursor in the list item
Fixes #9233