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

Re: [mediaqueries] Trying to understand the syntax design

From: Lucas Wiener <lucas@wiener.se>
Date: Tue, 05 May 2015 06:59:52 +0000
Message-ID: <CAHGk_UydGwNPYZUoTnVkXepsO2Fam7NppPizjhUZa3NBMNykOg@mail.gmail.com>
Cc: Lucas Wiener <lucas@wiener.se>, www-style list <www-style@w3.org>
To: "Tab Atkins Jr. " <jackalmage@gmail.com>, Florian Rivoal <florian@rivoal.net>
Okay thank you both for the explanation.

Do you know if there are any sources that I could cite regarding this?

Kind regards
Lucas Wiener

tis 5 maj 2015 kl 00:29 skrev Tab Atkins Jr. <jackalmage@gmail.com>:

> On Mon, May 4, 2015 at 7:37 AM, Florian Rivoal <florian@rivoal.net> wrote:
> > On 29 Apr 2015, at 14:11, Lucas Wiener <lucas@wiener.se> wrote:
> >> I'm trying to understand the reasons for the syntax design of media
> queries.
> >> Are there any reasons why media queries are written "@media (min-width:
> >> 500px) { … }" instead of "@media (width >= 500px) { … }"?
> >
> > Legacy. The min- and max- syntax were what was introduced way back,
> chiefly
> > (I believe, that's before my time) due to compat concerns of using the
> > < (and >) characters inside html.
>
> Yup.  It's from *way* back when, when you had to do the:
>
> <style>
> <!--
> styles here
> -->
> </style>
>
> trick to keep some legacy browsers from displaying your stylesheet as
> text.  It's been irrelevant for over a decade, which is why we finally
> added the originally-desired syntax to MQ4. ^_^
>
> ~TJ
>
Received on Monday, 11 May 2015 16:03:32 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:54 UTC