W3C home > Mailing lists > Public > public-css-archive@w3.org > October 2019

Re: [csswg-drafts] [css-values] Ability to address actual physical size (#614)

From: BevansDesign via GitHub <sysbot+gh@w3.org>
Date: Thu, 10 Oct 2019 20:42:50 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-540783753-1570740169-sysbot+gh@w3.org>
This issue needs to be reopened. Physical units are essential to the future of CSS design. It's not going to be effortless, and it probably can't be done without "cracking a few eggs", but it needs to be done anyway.

Uncoupling physical units from pixels is the most obvious solution, of course. I really don't think we should worry about breaking any sites that use `in` or `cm` right now, because they shouldn't be doing that in the first place, and they can easily change to `px`. I'm not sure what the effect would be for print, but that can be adjusted too.

And if uncoupling is impossible or too undesirable, then just create new units, like `rin` (real inches) and `rcm` (real centimeters).

Obviously a big issue is knowing the device's screen's physical dimensions in the first place. Here are some solutions for that, in order of usefulness:

Long term: Devices would report their screen's _usable_ physical dimensions to the OS, which would pass that along to the browser. This would be specified by the manufacturers in the same way that the device's name is right now.

Medium term: Browsers already have access to things like device names, OS versions, pixel dimensions, etc., and that can be matched against a database to infer the physical size of the device. For example, a "Samsung SM-G960U" is this big, an "Apple iPhone" with these pixel dimensions is this big, and so on. (This could probably also be done with a Javascript library, if anyone wants to tackle that.) Obviously, this solution leaves out many desktop devices.

Short term: Ask the user! Have the browser ask them to get out a ruler and measure their screen. They could probably just insert the diagonal size, and have the device figure out the rest based on the pixel dimensions.

Shortest term: Use what we have now, or fall back to default sizes for devices. A smartphone could be assumed to be 5in, a tablet 10in, a desktop 16in - or whatever makes sense.

I know these ideas aren't perfect, but I hope they at least demonstrate that we _can_ implement physical units in CSS - but it's not going to fall into our lap.

GitHub Notification of comment by BevansDesign
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/614#issuecomment-540783753 using your GitHub account
Received on Thursday, 10 October 2019 20:42:52 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:54 UTC