News for hackers. Stuff that matters.
Re: Pixels and Accessibility by teddyh on Wednesday May 18, 2022 @01:55PM (#31425673)
> 1px is equal to a single dot in a computer monitor or phone screen.

Far from always!

“For screen displays, it traditionally represents one device pixel (dot). However, for printers and high-resolution screens, one CSS pixel implies multiple device pixels. 1px = 1/96th of 1in.”

— https://developer.mozilla.org/en-US/docs/Web/CSS/length

Re: Pixels and Accessibility by TotempaaltJ on Wednesday May 18, 2022 @03:45PM (#31426817)
The article does talk about this directly after about the sentence you quoted.
Re: Pixels and Accessibility by CharlesW on Wednesday May 18, 2022 @04:01PM (#31426986)
But the part the parent commenter quoted is incorrect and the article would be better for having that fixed. The explanation that follows is misleading as well (it's not a "bit of a lie") and would also benefit from not introducing hardware sub-pixels into the discussion (which are irrelevant).
Re: Pixels and Accessibility by jan_Inkepa on Wednesday May 18, 2022 @03:15PM (#31426522)
>“For screen displays, it traditionally represents one device pixel (dot). However, for printers and high-resolution screens, one CSS pixel implies multiple device pixels. 1px = 1/96th of 1in.”

And this multiple isn't necessarily an integer, it's specified as a floating point number (though I've in practice only seen fractional parts of .5 (on a samsung galaxy IIRC) )

( https://developer.mozilla.org/en-US/docs/Web/API/Window/devi... )

Re: Pixels and Accessibility by tadfisher on Thursday May 19, 2022 @02:21AM (#31431336)
Blink on Android maps CSS pixels to Android's DP (density-independent pixel) unit, which is derived from a device's "density bucket", which traditionally has been defined by some multiple of 160ppi in .5x increments. There are some oddball values out there (e.g. the "tvdpi" bucket for Android TV apps), but you'll usually see the .5 multiple on phone-sized screens.