How do you approach height responsive website?

So i developed webapp in react + chakra-ui. I was developing it on monitor with 2160 height dimensions (either 4k or UHD). When i opened application on full HD monitor (1920 x 1080) everything looks so big. Header, Left and Right sidebar. Most of the time I was fusing on width responsiveness and this issue got me thinking. One idea I have i my mind is to use "em" unit everywhere (even on fontSize) and scale it on the parent using media query. What is you approach to something like this?
7 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Jochem
Jochem2y ago
using em on font size can cause non-linear size changes when you nest redeclarations
Kevin Powell
Kevin Powell2y ago
I mean, even a px isn't a screen pixel, so 10px on a 4k should look the same as 10px on a HD monitor... maybe there is something else
b1mind
b1mind2y ago
Lets try to provide a bit more help than just "use flex" - Note I'm somewhat guilty of saying "just use grid" but after I try to provide an explanation/demo of how it would work. Could the issue be you are using vh/vw for things? @Interpod This is the reason you really need to provide a minimal example, all we can do is guess. https://codepen.io/b1mind/pen/PojdyQz?editors=0110 here is my goto example for 100 height though if it helps.
interpod
interpodOP2y ago
@Kevin in such case if i have resolution 1080 and two column layout one 500px and second one 800px then there will be overflow on both 4k resolution and full-hd resolution ? Maybe I wasn't specific enough. Two monitors, one has resolution 1080 and the other 1920. Let me give an example. I have top navbar which is, two buttons ( 100px height each) and (200 padding top + bottom) which is 300px. For monitor which has 1000px height, it will be 1/3 of whole height (this navbar occupies). for monitor which has 2000 it will be 1/6 of whole hight which is really small i guess
b1mind
b1mind2y ago
Provide an example at this point it's just round and round.
Kevin Powell
Kevin Powell2y ago
A CSS pixel is not a screen pixel. Technically, 1000px will look the same on both monitors, regardless of their size and resolution. It's not always perfect, but tends to be pretty close. If not, 10px on a low res device and on a phone with >300dpi would look vastly different
Want results from more Discord servers?
Add your server