logoalt Hacker News

notatoadtoday at 3:16 PM1 replyview on HN

px is still a useful unit. the user's operating system applying a scaling fator doesn't make it not useful.

if the user's operating system is configured to draw pixels at a 1:1 ratio, your pixels will be drawn at a 1:1 ratio. if the user's operating system is configured to draw pixels at a 2:1 or 3:1 ratio, you as a web developer don't get to override that, but you're still addressing pixels directly. if you want to write software that manages the user's hardware directly without giving them options to override it, the web is probably not the right platform for you.


Replies

somattoday at 3:47 PM

The spec fafs around a bit talking about how the px is a "visual angle unit" But I am unable to form an interpretation where the "reference pixel" is anything other than 1/96 inch.

https://drafts.csswg.org/css-values/#absolute-lengths

I guess theoretically a tv could say "this tv will be viewed at 12 feet away so our reference pixel is 1/16 inch" and still be in spec. Which sounds like it has messy implications, Does anyone do this?

Anyway the point being a pixel should fundamentally be a hardware measurement, and if they wanted a "visual angle unit" they should have introduced one.(the moa?) But the last thing we need is a pixel being defined as a hard 1/96 of a inch. which is what we got.

show 2 replies