@@ -38,24 +38,24 @@ $mat-calendar-range-end-body-cell-size:
38
38
cursor : pointer ;
39
39
}
40
40
41
- .mat-calendar-body-cell ::before ,
42
- .mat-calendar-body-cell ::after ,
43
- .mat-calendar-body-comparison-bridge-start ::before {
41
+ .mat-calendar-body-cell {
44
42
// We use ::before to apply a background to the body cell, because we need to apply a border
45
43
// radius to the start/end which means that part of the element will be cut off, making
46
44
// hovering through all the cells look glitchy. We can't do it on the cell itself, because
47
45
// it's the one that has the event listener and it can't be on the cell content, because
48
46
// it always has a border radius.
49
- content : ' ' ;
50
- position : absolute ;
51
- top : $mat-calendar-body-cell-content-margin ;
52
- left : 0 ;
53
- z-index : 0 ;
47
+ & ::before , & ::after {
48
+ content : ' ' ;
49
+ position : absolute ;
50
+ top : $mat-calendar-body-cell-content-margin ;
51
+ left : 0 ;
52
+ z-index : 0 ;
54
53
55
- // We want the range background to be slightly shorter than the cell so
56
- // that there's a gap when the range goes across multiple rows.
57
- height : $mat-calendar-body-cell-content-size ;
58
- width : 100% ;
54
+ // We want the range background to be slightly shorter than the cell so
55
+ // that there's a gap when the range goes across multiple rows.
56
+ height : $mat-calendar-body-cell-content-size ;
57
+ width : 100% ;
58
+ }
59
59
}
60
60
61
61
.mat-calendar-body-range-start :not (.mat-calendar-body-in-comparison-range )::before ,
@@ -99,15 +99,24 @@ $mat-calendar-range-end-body-cell-size:
99
99
}
100
100
}
101
101
102
+ // Styles necessary to make RTL work.
102
103
[dir = ' rtl' ] {
103
104
.mat-calendar-body-comparison-bridge-start.mat-calendar-body-range-end ::after ,
104
- .mat-calendar-body-comparison-bridge-end.mat-calendar-body-range-start ::after ,
105
- .mat-calendar-body-range-start.mat-calendar-body-range-end ::before ,
106
- .mat-calendar-body-range-start.mat-calendar-body-range-end ::after {
105
+ .mat-calendar-body-comparison-bridge-end.mat-calendar-body-range-start ::after {
107
106
@include _mat-calendar-body-range-right-radius ;
108
107
}
109
108
}
110
109
110
+ // Prevents the extra overlap range indication from showing up when it's not supposed to.
111
+ .mat-calendar-body-comparison-start.mat-calendar-body-range-end ::after ,
112
+ .mat-calendar-body-comparison-end.mat-calendar-body-range-start ::after {
113
+ // Note that the RTL selector here is redundant, but we need to keep it in order to
114
+ // raise the specificity since it can be overridden by some of the styles from above.
115
+ & , [dir = ' rtl' ] & {
116
+ width : $mat-calendar-body-cell-content-size ;
117
+ }
118
+ }
119
+
111
120
.mat-calendar-body-disabled {
112
121
cursor : default ;
113
122
}
0 commit comments