Modal View stuck to bottom of page


I want to create CSS where the modal view can be placed at the bottom of the page. The modal transitions from bottom to top, and fixes itself to the screen at the bottom (very similar to action sheet).

Any help is appreciated.


I have found this codepen -

But how do i dynamically allocate height of the modal - some modals might have larger screen size and some smaller, and I want to automaticallly control height from CSS - is this possible?