Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit bd605c0

Browse files
clshortfusejelbourn
authored andcommitted
fix(sidenav): correct animation from closed to locked open (#9833)
sidenav was missing CSS a pre-animation state when transitioning from closed to locked open * Add CSS for missing pre-animation state * Add comments to clarify animation logic Fixes #9425
1 parent 80e87b5 commit bd605c0

File tree

1 file changed

+36
-10
lines changed

1 file changed

+36
-10
lines changed

src/components/sidenav/sidenav.scss

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,55 +18,81 @@ md-sidenav {
1818
list-style: none;
1919
}
2020

21+
// Animation Comment Syntax: [mdLockedOpen]|[mdClosed]
22+
// mdLockedOpen states: unlocked, locked, any
23+
// mdClosed states: open, closed, any
24+
// Default state: unlocked|open
25+
26+
// unlocked|closed
2127
&.md-closed {
2228
display: none;
2329
}
30+
31+
// any|open <=> any|closed
2432
&.md-closed-add,
2533
&.md-closed-remove {
2634
display: flex;
2735
transition: 0.2s ease-in all;
2836
}
2937

38+
// any|open <=> any|closed (animating)
3039
&.md-closed-add.md-closed-add-active,
3140
&.md-closed-remove.md-closed-remove-active {
3241
transition: $swift-ease-out;
3342
}
3443

44+
// unlocked|any <=> locked|any
3545
&.md-locked-open-add,
3646
&.md-locked-open-remove {
3747
position: static;
3848
display: flex;
3949
transform: translate3d(0, 0, 0);
4050
}
4151

52+
// locked|any
4253
&.md-locked-open,
4354
&.md-locked-open.md-closed,
4455
&.md-locked-open.md-closed.md-sidenav-left,
45-
&.md-locked-open.md-closed.md-sidenav-right,
56+
&.md-locked-open.md-closed.md-sidenav-right {
57+
position: static;
58+
display: flex;
59+
transform: translate3d(0, 0, 0);
60+
}
61+
62+
// locked|closed => unlock|closed
4663
&.md-locked-open-remove.md-closed {
4764
position: static;
4865
display: flex;
4966
transform: translate3d(0, 0, 0);
5067
}
51-
&.md-locked-open-remove-active {
68+
69+
// unlocked|closed => locked|closed
70+
&.md-closed.md-locked-open-add {
71+
position: static;
72+
display: flex;
73+
transform: translate3d(0%, 0, 0);
74+
}
75+
76+
// unlocked|closed => locked|closed (pre-animation)
77+
&.md-closed.md-locked-open-add:not(.md-locked-open-add-active) {
5278
transition: width $swift-ease-in-duration $swift-ease-in-timing-function,
5379
min-width $swift-ease-in-duration $swift-ease-in-timing-function;
5480
width: 0 !important;
5581
min-width: 0 !important;
5682
}
5783

58-
&.md-closed.md-locked-open-add {
59-
width: 0 !important;
60-
min-width: 0 !important;
61-
transform: translate3d(0%, 0, 0);
84+
// unlocked|closed => locked|closed (animating)
85+
&.md-closed.md-locked-open-add-active {
86+
transition: width $swift-ease-in-duration $swift-ease-in-timing-function,
87+
min-width $swift-ease-in-duration $swift-ease-in-timing-function;
6288
}
6389

64-
&.md-closed.md-locked-open-add-active {
90+
// locked|any => unlocked|any (animating)
91+
&.md-locked-open-remove-active {
6592
transition: width $swift-ease-in-duration $swift-ease-in-timing-function,
6693
min-width $swift-ease-in-duration $swift-ease-in-timing-function;
67-
width: $sidenav-mobile-width;
68-
min-width: $sidenav-mobile-width;
69-
transform: translate3d(0%, 0, 0);
94+
width: 0 !important;
95+
min-width: 0 !important;
7096
}
7197

7298
@extend .md-sidenav-left;

0 commit comments

Comments
 (0)