You can do a fair amount these days with CSS thanks to flex-box, it handles the row based layout transition to column based quite well.
A benefit of using CSS is that it handles browser zoom and high dpi screens much better as you can use units other than pixels (eg: em/rem, vh/vw, %).
From a architecture point of view, you want to keep layout logic out of the JavaScript anyways as JS should be for interactions and other 'nice to have' behaviors.
A benefit of using CSS is that it handles browser zoom and high dpi screens much better as you can use units other than pixels (eg: em/rem, vh/vw, %).
From a architecture point of view, you want to keep layout logic out of the JavaScript anyways as JS should be for interactions and other 'nice to have' behaviors.