Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wow, they managed to make a website that scales everything except the main text when adjusting the browser's zoom setting.


They set the root font size relative to the total width of the screen (1.04vw) with the rest of the styling using rem units

Ive never seen anyone do that before.. It may well be the only way to circumvent browser zoom


Why don't browsers reduce the screen width when you zoom in, as they adjust every other unit (cm, px)?


They effectively do. All css absolute units are effectively defined as ratios of each other and zoom*DPI*physicalPixels sets the ratio of how many physical pixels each absolute unit will end up turning into. Increase zoom and the screen seems to have shrunk to some smaller 'cm' and so on.

For things like 'vh' and 'vw' it just doesn't matter "how many cm" the screen is as 20% of the viewing space always comes out to 20% of the viewing space regardless how many 'cm' that is said to be equivalent to.


Oh duh, right. Thanks!


Why is it so desirable to circumvent browser zoom? I hate it.


There should be a law for this. Who in their right mind wants this?


It's interesting how this (and other css?) means the website is readable in a phone in portrait, but the text is tiny in landscape!


It's a quantum zoom: it's zoomed in and not zoomed in at the same time.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: