Skip to content

Commit 46ca6ce

Browse files
crisbetojelbourn
authored andcommitted
fix(table,sort,paginator): incorrect spacing in rtl (#10617)
Fixes a few instances in the `table`, `sort` and `paginator` modules where the spacings weren't being inverted in RTL layouts.
1 parent 2dc4e70 commit 46ca6ce

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

src/lib/paginator/paginator.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ $mat-paginator-button-last-increment-icon-margin: 9px;
4545
display: flex;
4646
align-items: baseline;
4747
margin-right: $mat-paginator-page-size-margin-right;
48+
49+
[dir='rtl'] & {
50+
margin-right: 0;
51+
margin-left: $mat-paginator-page-size-margin-right;
52+
}
4853
}
4954

5055
.mat-paginator-page-size-label {

src/lib/sort/sort-header.scss

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,16 @@ $mat-sort-header-arrow-hint-opacity: 0.38;
3434
height: $mat-sort-header-arrow-container-size;
3535
width: $mat-sort-header-arrow-container-size;
3636
min-width: $mat-sort-header-arrow-container-size;
37-
margin: 0 0 0 $mat-sort-header-arrow-margin;
3837
position: relative;
3938
display: flex;
4039

41-
.mat-sort-header-position-before & {
40+
&,
41+
[dir='rtl'] .mat-sort-header-position-before & {
42+
margin: 0 0 0 $mat-sort-header-arrow-margin;
43+
}
44+
45+
.mat-sort-header-position-before &,
46+
[dir='rtl'] & {
4247
margin: 0 $mat-sort-header-arrow-margin 0 0;
4348
}
4449
}

src/lib/table/table.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,20 @@ mat-row, mat-header-row {
3636

3737
mat-cell:first-child, mat-header-cell:first-child {
3838
padding-left: $mat-row-horizontal-padding;
39+
40+
[dir='rtl'] & {
41+
padding-left: 0;
42+
padding-right: $mat-row-horizontal-padding;
43+
}
3944
}
4045

4146
mat-cell:last-child, mat-header-cell:last-child {
4247
padding-right: $mat-row-horizontal-padding;
48+
49+
[dir='rtl'] & {
50+
padding-right: 0;
51+
padding-left: $mat-row-horizontal-padding;
52+
}
4353
}
4454

4555
mat-cell, mat-header-cell {

0 commit comments

Comments
 (0)