@@ -37,7 +37,9 @@ mat-row, mat-header-row, mat-footer-row {
3737 }
3838}
3939
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 {
4143 padding-left : $mat-row-horizontal-padding ;
4244
4345 [dir = ' rtl' ] & {
@@ -46,7 +48,7 @@ mat-cell:first-child, mat-header-cell:first-child, mat-footer-cell:first-child {
4648 }
4749}
4850
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 {
5052 padding-right : $mat-row-horizontal-padding ;
5153
5254 [dir = ' rtl' ] & {
@@ -89,10 +91,12 @@ th.mat-header-cell, td.mat-cell, td.mat-footer-cell {
8991 border-bottom-style : solid ;
9092}
9193
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 {
9397 padding-left : $mat-row-horizontal-padding ;
9498}
9599
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 {
97101 padding-right : $mat-row-horizontal-padding ;
98102}
0 commit comments