#216 add card layout that automatically adjusts its preferred size to the selected content