Re: [mediaqueries] Trying to understand the syntax design

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, 4 May 2015 22:30:27 UTC