[whatwg] Features for responsive Web design
kornel at geekhood.net
Thu Aug 9 09:54:10 PDT 2012
On 9 sie 2012, at 11:06, Nils Dagsson Moskopp <nils at dieweltistgarnichtso.net> wrote:
>> I don't think anybody will take advantage of that. IMHO non-integer
>> ratios are a mistake that can/will be corrected.
> Limiting to powers of two because it can/will be “simpler” in this case
> not only makes the attribute harder to read – it also locks vendors in.
I'm not talking just about difficulty of specifying image scaling factor, but overall difficulty of developing complete page layout with all box, border and margin sizes in fractional CSS pixels.
I assume that if a designer cares enough to create several pixel-perfect versions of images, they will also want same pixel perfection from all other page features, e.g. will hate that on 1.5dppx screen a 1px border is rendered with 1dpx in one place, but 2dpx in another (or differently blurry 2dpx in both places) and will want to specify 0.6666px or 1.3333px border instead.
One stylesheet can be easily reused for pixel-perfect 1x/2x layout, but pixel-perfect 1.5x requires its own sizes incompatible with 1x/2x.
> Apart from it possibly being a self-fulfilling prophecy – isn't this
> too much premature “optimization” ?
I think we can safely assume that authors will always want to prepare as few assets and stylesheets as they can, and will prefer integer units to fractional ones (1px line vs 1.3333px line).
> Btw, I am not aware of any other attribute that has a logarithmic scale
> baked in – are you?
Best scaling ratios are linear, rounded to nearest integer (i.e. 3x is OK too).
That's quite common in computer science, and not surprising when dealing with discrete unit like device pixel.
More information about the whatwg