|
3 | 3 | @import '../core/style/layout-common'; |
4 | 4 | @import '../core/a11y/a11y'; |
5 | 5 |
|
6 | | - |
7 | | -// Mixin to help with defining LTR/RTL 'transform: translate3d()' values. |
8 | | -// @param $open The translation value when the sidenav is opened. |
9 | | -// @param $close The translation value when the sidenav is closed. |
10 | | -@mixin mat-sidenav-transition($open, $close) { |
11 | | - transform: translate3d($close, 0, 0); |
12 | | - |
13 | | - &.mat-sidenav-closed { |
14 | | - // We use 'visibility: hidden | visible' because 'display: none' will not animate any |
15 | | - // transitions, while visibility will interpolate transitions properly. |
16 | | - // see https://developer.mozilla.org/en-US/docs/Web/CSS/visibility, the Interpolation |
17 | | - // section. |
18 | | - visibility: hidden; |
19 | | - } |
20 | | - |
21 | | - &.mat-sidenav-opening, &.mat-sidenav-opened { |
22 | | - transform: translate3d($open, 0, 0); |
23 | | - } |
24 | | -} |
25 | | - |
26 | 6 | // Mixin that creates a new stacking context. |
27 | 7 | // see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context |
28 | 8 | @mixin mat-sidenav-stacking-context() { |
|
103 | 83 | box-sizing: border-box; |
104 | 84 | height: 100%; |
105 | 85 | overflow-y: auto; // TODO(kara): revisit scrolling behavior for sidenavs |
106 | | - |
107 | | - @include mat-sidenav-transition(0, -100%); |
| 86 | + transform: translate3d(-100%, 0, 0); |
| 87 | + visibility: hidden; |
108 | 88 |
|
109 | 89 | &.mat-sidenav-side { |
110 | 90 | z-index: 1; |
111 | 91 | } |
112 | 92 |
|
113 | 93 | &.mat-sidenav-end { |
114 | 94 | right: 0; |
115 | | - |
116 | | - @include mat-sidenav-transition(0, 100%); |
| 95 | + transform: translate3d(100%, 0, 0); |
117 | 96 | } |
118 | 97 |
|
119 | 98 | [dir='rtl'] & { |
120 | | - @include mat-sidenav-transition(0, 100%); |
| 99 | + transform: translate3d(100%, 0, 0); |
121 | 100 |
|
122 | 101 | &.mat-sidenav-end { |
123 | 102 | left: 0; |
124 | 103 | right: auto; |
125 | | - |
126 | | - @include mat-sidenav-transition(0, -100%); |
| 104 | + transform: translate3d(-100%, 0, 0); |
127 | 105 | } |
128 | 106 | } |
129 | 107 |
|
|
0 commit comments