Never mind – my bad. It works but on collapsing the sub-menu disappears immediately, while the height transition is gradual. I applied the transition to the expanding state only and at least no there are no empty spaces during the animation.
#generate-slideout-menu.main-navigation .main-nav .slideout-menu ul {
display: block !important;
max-height: 0;
overflow: hidden;
height: unset;
}
#generate-slideout-menu.main-navigation .slideout-menu ul.toggled-on {
max-height: 1000px;
transition: max-height 0.3s ease-in;
}
Ideally, the animation would go in both directions though.
Also, any ideas for the desktop version?