W3C home > Mailing lists > Public > www-style@w3.org > April 2015

Re: [css-device-adaptation] Possible Example error?

From: Rune Lillesveen <rune@opera.com>
Date: Mon, 13 Apr 2015 11:57:07 +0200
Message-ID: <CANz6XvTnbOv4unSzhoHBmS0t5mibDr6TYfhBknh6L=-qEjXoWg@mail.gmail.com>
To: Andrea Rendine <master.skywalker.88@gmail.com>
Cc: www-style list <www-style@w3.org>
On Sun, Apr 5, 2015 at 5:57 AM, Andrea Rendine
<master.skywalker.88@gmail.com> wrote:
> Example V:
> The green color should be applied to a div because the initial viewport
> width is used to evaluate the media query for the second @viewport rule, but
> the actual viewport is used for evaluating the media query when applying
> style rules.
> @viewport {
>   width: 397px;
> }
>
> @media screen and (width: 397px) {
>   @viewport {
>     width: 500px;
>   }
> }
>
> @media screen and (width: 397px) {
>   div { color: green; }
> }
>
> Shouldn't the last instruction be
> @media screen and (width: 500px) {
>   div { color: green; }
> }
>
> in order to show how different viewport apply to different situations, as
> stated by the example introduction?
> @viewport sets initial width to 397px > first media query is evaluated >
> viewport width is set to 500px > second media query is evaluated according
> to actual value
>
> Is that correct?

The example is correct as it stands.

-- 
Rune Lillesveen
Received on Monday, 13 April 2015 09:57:34 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:30 UTC