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

[mediaqueries] "discrete" MQs that are still ordered; allow < and other ops?

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 30 May 2014 13:47:53 -0700
Message-ID: <CAAWBYDBSG7AHWu1TkadOCx8w=i0BeOv3BSJuqN4PYTxqexfzKA@mail.gmail.com>
To: www-style list <www-style@w3.org>
While adding an example to the 'update-frequency' MQ, I noticed that
the code would be a little better to write if I could say "slow or
better".

There are a few ways to achieve that today:

not (update-frequency: none)
(update-frequency: slow) or (update-frequency: normal)

But neither of them are very satisfactory.

The fact is that update-frequency is an ordered list of keywords.
There's no numeric units, if there were, "slow" would be greater than
"none", and "normal" would be greater than "slow".  It feels like it
would be kinda natural to be able to say:

(update-frequency >= slow)

Currently the spec divides MQs into two categories, "discrete" and
"range", and allows the numeric operators on the latter only.  What do
people think about defining an in-between category ("ordered"?) that
is just keywords, like "discrete", but defines an ordering over them,
so you get all the effects of a "range" type?

~TJ
Received on Friday, 30 May 2014 20:48:40 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:51:27 UTC