File tree Expand file tree Collapse file tree 4 files changed +33
-14
lines changed Expand file tree Collapse file tree 4 files changed +33
-14
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ <h4 mat-line>{{message.from}}</h4>
3131 < span > {{message.subject}} -- </ span >
3232 < span class ="demo-secondary-text "> {{message.message}}</ span >
3333 </ p >
34- < mat-divider [ inset] =" true " *ngIf ="!last "> </ mat-divider >
34+ < mat-divider inset *ngIf ="!last "> </ mat-divider >
3535 </ mat-list-item >
3636 < mat-divider > </ mat-divider >
3737 < mat-list-item *ngFor ="let message of messages ">
@@ -87,10 +87,11 @@ <h2>Nav lists</h2>
8787 </ mat-list-item >
8888 </ mat-nav-list >
8989 < mat-nav-list >
90- < a mat-list-item *ngFor ="let link of links " href ="http://www.google.com ">
90+ < a mat-list-item *ngFor ="let link of links; last as last " href ="http://www.google.com ">
9191 < mat-icon mat-list-icon > folder</ mat-icon >
9292 < span mat-line > {{ link.name }}</ span >
9393 < span mat-line class ="demo-secondary-text "> Description </ span >
94+ < mat-divider inset *ngIf ="!last "> </ mat-divider >
9495 </ a >
9596 </ mat-nav-list >
9697 < mat-nav-list dense >
Original file line number Diff line number Diff line change 11$mat-divider-width : 1px ;
22$mat-divider-inset-margin : 80px ;
33
4+ // This mixin provides the correct offset for an inset divider based on the
5+ // size of the parent class (e.g. avatar vs icon)
6+ @mixin mat-inset-divider-offset ($offset , $padding ) {
7+ $mat-inset-divider-offset : #{(2 * $padding ) + $offset } ;
8+ margin-left : $mat-inset-divider-offset ;
9+ width : calc (100% - #{$mat-inset-divider-offset } );
10+
11+ [dir = ' rtl' ] & {
12+ margin-left : auto ;
13+ margin-right : $mat-inset-divider-offset ;
14+ }
15+ }
16+
417.mat-divider {
518 display : block ;
619 margin : 0 ;
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ ng_module(
2323sass_binary (
2424 name = "list_scss" ,
2525 src = "list.scss" ,
26- deps = ["//src/lib/core:core_scss_lib" ],
26+ deps = ["//src/lib/core:core_scss_lib" , "//src/lib/divider:divider_scss" ],
2727)
2828
2929# TODO(jelbourn): remove this when sass_binary supports specifying an output filename and dir.
Original file line number Diff line number Diff line change 11@import ' ../core/style/variables' ;
22@import ' ../core/style/list-common' ;
33@import ' ../core/style/layout-common' ;
4+ @import ' ../divider/divider' ;
45
56
67$mat-list-side-padding : 16px ;
8+ $mat-list-icon-padding : 4px ;
79$mat-list-avatar-size : 40px ;
810
911// Normal list variables
@@ -108,6 +110,10 @@ $mat-list-item-inset-divider-offset: 72px;
108110 width : $mat-list-avatar-size ;
109111 height : $mat-list-avatar-size ;
110112 border-radius : 50% ;
113+
114+ ~ .mat-divider-inset {
115+ @include mat-inset-divider-offset ($mat-list-avatar-size , $mat-list-side-padding );
116+ }
111117 }
112118
113119 .mat-list-icon {
@@ -116,29 +122,28 @@ $mat-list-item-inset-divider-offset: 72px;
116122 font-size : $icon-size ;
117123 box-sizing : content-box ;
118124 border-radius : 50% ;
119- padding : 4px ;
125+ padding : $mat-list-icon-padding ;
126+
127+ ~ .mat-divider-inset {
128+ @include mat-inset-divider-offset ($icon-size + (2 * $mat-list-icon-padding ),
129+ $mat-list-side-padding );
130+ }
120131 }
121132
122133 .mat-divider {
123134 position : absolute ;
124135 bottom : 0 ;
125136 left : 0 ;
126137 width : 100% ;
138+ margin : 0 ;
127139
128140 [dir = ' rtl' ] & {
129- left : auto ;
130- right : 0 ;
141+ margin- left : auto ;
142+ margin- right : 0 ;
131143 }
132144
133145 & .mat-divider-inset {
134- left : $mat-list-item-inset-divider-offset ;
135- width : calc (100% - #{$mat-list-item-inset-divider-offset } );
136- margin : 0 ;
137-
138- [dir = ' rtl' ] & {
139- left : auto ;
140- right : $mat-list-item-inset-divider-offset ;
141- }
146+ position : absolute ; // necessary to override card styles
142147 }
143148 }
144149}
You can’t perform that action at this time.
0 commit comments