I am trying to create a sliding animation only using CSS. JavaScript is used just to toggle the open/close state of the element.
I can use translated and rotateX CSS transforms to hide/show the menu. But those techniques do not reduce/increase the height of the element, and thus the parent does not follow the children height.
I want to be able to slide up/down an element inside its parent, while the parent also collapses and expands. And I want to do this using transitions so that a sliding-up/down animation would be shown.
Here is my codesandbox