@@ -37,7 +37,9 @@ mat-row, mat-header-row, mat-footer-row {
37
37
}
38
38
}
39
39
40
- mat-cell :first-child , mat-header-cell :first-child , mat-footer-cell :first-child {
40
+ // Note: we use `first-of-type`/`last-of-type` here in order to prevent extra
41
+ // elements like ripples or badges from throwing off the layout (see #11165).
42
+ mat-cell :first-of-type , mat-header-cell :first-of-type , mat-footer-cell :first-of-type {
41
43
padding-left : $mat-row-horizontal-padding ;
42
44
43
45
[dir = ' rtl' ] & {
@@ -46,7 +48,7 @@ mat-cell:first-child, mat-header-cell:first-child, mat-footer-cell:first-child {
46
48
}
47
49
}
48
50
49
- mat-cell :last-child , mat-header-cell :last-child , mat-footer-cell :last-child {
51
+ mat-cell :last-of-type , mat-header-cell :last-of-type , mat-footer-cell :last-of-type {
50
52
padding-right : $mat-row-horizontal-padding ;
51
53
52
54
[dir = ' rtl' ] & {
@@ -89,10 +91,12 @@ th.mat-header-cell, td.mat-cell, td.mat-footer-cell {
89
91
border-bottom-style : solid ;
90
92
}
91
93
92
- th .mat-header-cell :first-child , td .mat-cell :first-child , td .mat-footer-cell :first-child {
94
+ // Note: we use `first-of-type`/`last-of-type` here in order to prevent extra
95
+ // elements like ripples or badges from throwing off the layout (see #11165).
96
+ th .mat-header-cell :first-of-type , td .mat-cell :first-of-type , td .mat-footer-cell :first-of-type {
93
97
padding-left : $mat-row-horizontal-padding ;
94
98
}
95
99
96
- th .mat-header-cell :last-child , td .mat-cell :last-child , td .mat-footer-cell :last-child {
100
+ th .mat-header-cell :last-of-type , td .mat-cell :last-of-type , td .mat-footer-cell :last-of-type {
97
101
padding-right : $mat-row-horizontal-padding ;
98
102
}
0 commit comments