Re: CSS-4 and min|max-device-width

On Mon, Jan 8, 2018 at 9:38 AM, Levantovsky, Vladimir
<Vladimir.Levantovsky@monotype.com> wrote:
> On Sunday, January 07, 2018 6:20 AM Henrik Andersson wrote:
>> To: Alice Wonder; www-style@w3.org
>> Subject: Re: CSS-4 and min|max-device-width
>>
>> So to summarize, you actually want a media query that determinates the
>> viewport width while ignoring zooming.
>> Or in other words, you want the layout to remain locked down independently
>> of the device zoom level.
>
> I believe that having a media query that determines width while ignoring
> zoom level would also be a useful feature for CSS4 font-variation-settings
> property. If a website content is presented with a specific font variation
> feature set based on a particular width, you wouldn’t want that setting to
> be changing based on zoom level, and risk having the text content be
> re-rendered and reflow because of it. People often zoom in to make text
> easier to read, but you'd want to preserve the original layout at the same
> time.

Note the *very important* distinction between browser zoom (which
affect the device-* queries) and pinch-zoom, which does not.
Browser-zoom actually changes the sizes of the units, and reduces the
size of the viewport accordingly (so that its reported width, in the
new, larger units, is exactly the actual width of the device).
Pinch-zoom doesn't do any of this, it's more like a transform.

Browser-zoom already, almost by definition, causes reflows. Having
text change as a result as well is completely fine.  (Or if it's not,
then what you actually want is to discriminate based on the resolution
of the device, which is also available via MQ.)  Pinch-zoom never
causes reflows (unless it's buggy), and text wouldn't change due to it
either.

> What problem does removing device-width media queries solve?

Trying to infer the user's hardware, and that hardware's capabilities,
from window size has always been a game you can't win. There are
better ways to do this, and when there are holes in the provided
information, filling those in directly with new MQs is much better
than trying to guess based on a size.

~TJ

Received on Monday, 8 January 2018 20:04:42 UTC