W3C home > Mailing lists > Public > www-style@w3.org > January 2009

RE: [css3-values] new editor's draft (and [css3-box])

From: Alex Mogilevsky <alexmog@microsoft.com>
Date: Mon, 19 Jan 2009 22:14:15 -0800
To: "'robert@ocallahan.org'" <robert@ocallahan.org>
CC: David Hyatt <hyatt@apple.com>, Håkon Wium Lie <howcome@opera.com>, Christoph Päper <christoph.paeper@crissov.de>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <7C2F64B551D8664AAD94A28DAC37D0206B5678CF6F@NA-EXMSG-C103.redmond.corp.microsoft.com>
Actually this wouldn't handle the target scenario of never scaling an image on client. Being a perfectionist photographer who wants to make sure any image scaling is done by the most advanced software, I would still be forced to write script that makes sure image size in device pixels is the perfect match to intrinsic size.

From: rocallahan@gmail.com [mailto:rocallahan@gmail.com] On Behalf Of Robert O'Callahan
Sent: Monday, January 19, 2009 2:37 PM
To: Alex Mogilevsky
Cc: David Hyatt; Håkon Wium Lie; Christoph Päper; www-style@w3.org
Subject: Re: [css3-values] new editor's draft (and [css3-box])

On Tue, Jan 20, 2009 at 11:15 AM, Alex Mogilevsky <alexmog@microsoft.com<mailto:alexmog@microsoft.com>> wrote:

"device-pixel-ratio" would be one of the ways to make it work (although setting sizes will be tricky and involve fractional pixels). Not sure if it's better than simply letting people use device pixels, since it makes it possible anyway.

I think for your use-case it's actually significantly easier to use device-pixel-ratio.

.image { background-image: url(1x.jpg); background-size:100%; width: Wpx; height: Hpx; }
@media (min-device-pixel-ratio: 1.5) { .image { background-image: url(2x.jpg); } }
@media (min-device-pixel-ratio: 2.5) { .image { background-image: url(3x.jpg); } }

Adding more image sizes is easy (whether you use fractional scalings or not) and you can be sure that the extra rules won't break your layout (or zooming), even if you get something wrong, because the image width and height remain specified in one place.

Rob
--
"He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all." [Isaiah 53:5-6]
Received on Tuesday, 20 January 2009 06:14:59 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:15 GMT