Skip to content

Commit

Permalink
Refact/menu collapse animation (#1507)
Browse files Browse the repository at this point in the history
* feat: use common collapse animation

* chore: remove useless styles

* fix: react collapse animation

---------

Co-authored-by: sunzhe <sunzhe@tencent.com>
  • Loading branch information
xiaosansiji and sunzhe authored Jul 25, 2023
1 parent 6209be4 commit dd930d9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
5 changes: 5 additions & 0 deletions style/web/_global.less
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@
}
}
}

.@{prefix}-slide-down-enter-active,
.@{prefix}-slide-down-leave-active {
transition: height @anim-duration-base @anim-time-fn-easing;
}
5 changes: 0 additions & 5 deletions style/web/components/collapse/_index.less
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,3 @@
}
}
}

.@{prefix}-slide-down-enter-active,
.@{prefix}-slide-down-leave-active {
transition: height @anim-duration-base, padding @anim-duration-base;
}
12 changes: 6 additions & 6 deletions style/web/components/menu/_index.less
Original file line number Diff line number Diff line change
Expand Up @@ -299,19 +299,19 @@ a.@{prefix}-menu__item {

.@{prefix}-menu__sub {
padding: 0;
max-height: 0;
overflow: hidden;
transition: max-height @anim-duration-base @anim-time-fn-easing;

&.@{prefix}-is-opened {
max-height: calc(100vh - @menu-height-default * 2);
}

.@{prefix}-menu__item {
padding-left: var(--padding-left, 32px);
}
}

.@{prefix}-slide-down-enter-active {
.@{prefix}-menu__sub {
height: 100%;
}
}

.@{prefix}-menu__item {
position: relative;
margin: @comp-margin-xs 0;
Expand Down

0 comments on commit dd930d9

Please sign in to comment.