3 ms·
As many noted, disabling pinch-/doubletap-zoom results in faster click events. It is hard to implement a scaling function if you designed your page using absol
by allendoerfer 11y ago
As many noted, disabling pinch-/doubletap-zoom results in faster click events.
It is hard to implement a scaling function if you designed your page using absolute pixels as units. With relative font-sizes (em,rem,vh,vw,wmax etc) you could just change the (absolute) font-size of the body tag to resize everything else. Scaling would then be easy to do in with a little JavasSript, a plugin or by just honoring the default body font-size the browser set.
The problem is, that using em makes your styles more complex. They are difficult to use, because ems are relative to the parent element for font-size and to the element itself for other attributes. If you define a font-size in em for an element you have to know, where you are going to put this element on the page. Define the font-size for a list, put a list inside a list and you messed up your design. Unfortunately the other relative units are not as well supported, so most websites just use pixels.
Many websites use the Bootstrap framework these days and Bootstrap uses pixels, too. Here is a discussion about the topic in their issue tracker:
https://github.com/twbs/bootstrap/issues/1943 https://github.com/twbs/bootstrap/issues/1943
Ultimately their solution is to drop IE8 support and use rem, which is relative to the body font-size, in version 4. I look forward to that. While people could still mess up the scaling by adding their own absolute font-size declarations, Bootstrap websites will then default to being easily scalable.