4 ms·
I don't get it. This technique "succeeds"... in that trying to zoom in/out of the page is broken, so pixels are truly staying pixels. But that defeats all the
by crazygringo 14y ago
I don't get it. This technique "succeeds"... in that trying to zoom in/out of the page is broken, so pixels are truly staying pixels.
But that defeats all the principles web sizing is based on. You should virtually never write CSS that is dependent on the physical pixels of the device. I can't even think of a case where you would want to.* Write code for logical pixels ("px"), and let the browser/device do all the zoom/dpi/retina/etc. calculations to give the user the size that makes sense for their display.
This is regression, not progress. The author says "px unit's don't scale"... No, they do scale, that's the whole point. The author's solution maps logical pixels to physical pixels, which is a bad idea.
* Sole exception being resolution of images (normal, retina, etc.), but that has nothing to do with "rem" units.
- salmanapk 14y agoThe broken zoom-in/out is probably a bug and should be fixed soon. I think you're confusing rem with vw/vh, rem has nothing to do with pixels AFAIK. 1em is equal to the font-size of the element you're applying it to while 1rem is always equal to the font-size of the root element i.e., <html>.