Ultimately, your granularity is 1 physical pixel (well technically a subpixel in modern browsers, but I will ignore this for the purposes of this discussion). You can have different calculated pixel values based on em or rem even up to a few digits of precision. Then, run into the real world of problems when rendering that decimal accuracy will be lost when the browser ultimately rounds up the size of pixels available at any pixel density of the device relative to the reference pixel density (96ppi).
In essence, this reference pixel is 1/96 of an inch. So 1px in CSS terms basically means 1/96 "at 96ppi. On screens with a higher pixel density (for example, 326 ppi of many Apple Retina screens), scaling occurs to convert the CSS reference pixel to physical pixels. , this scaling factor will be ~ 3.4. Therefore, if you specified a CSS rule to set something to 10px, the retina display browser should display at 34 physical pixels (assuming that there are no other HTML changes (that is, meta elements) will change the display behavior). Due to this scaling behavior, the physical size of the item will still be 10/96 ", which is exactly the same physical size as if the item was displayed on a 96ppi screen.
Now add em and rem to the mix. So let’s use an example font size of a 10px root element with a declaration on some other .001rem element. This would mean that you are trying to display this element on the reference pixels 0.01 (10px * .001rem), which will translate to 0.034 physical pixels on the retina screen. You can clearly see that the value of rem 0.001 is at least one order different from the significant difference in the physical display, since .01rem in this case translates to 0.34 physical pixels - no difference in rounding for display than for a more precise specification .001rem .
So, I think that you define blog-based CSS rules with much more specificity than you can actually fit in real-life conditions when drawing physical pixels, unless you have a very large root element size and / or you have a physical screen with pixel density is an order of magnitude greater than your retina screen. I assume this last case is incorrect.
Just because CSS can be calculated to the nearest ten decimal places or whatever, this does not mean that physical rendering can occur at the same level of accuracy.
Mike brant
source share