W3C home > Mailing lists > Public > www-style@w3.org > December 2013

Re: [indie-ui-context] boolean media queries should probably use 1/0 values, not on/off

From: L. David Baron <dbaron@dbaron.org>
Date: Tue, 10 Dec 2013 19:51:15 -0800
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: James Craig <jcraig@apple.com>, public-indie-ui-comments@w3.org, "www-style@w3.org list" <www-style@w3.org>
Message-ID: <20131211035115.GA6692@crum.dbaron.org>
On Wednesday 2013-12-11 14:12 +1100, Tab Atkins Jr. wrote:
> On Wed, Dec 11, 2013 at 12:40 PM, James Craig <jcraig@apple.com> wrote:
> > It was also recommended to switch the false value to “none” instead of “off” and that anything else was “truthy” which would allow the shorthand syntax.
> >
> > Is there a preference for 0 over none? As Tab mentioned, boolean media queries have a way of not remaining boolean.
> 
> Yes, please avoid using 0/1 for booleans; instead use none/anything
> else.  (grid) is the only boolean MQ still using 0/1 because we
> couldn't think of better words, and also don't really care about it.

Ah, I see mediaqueries Level 4 adds 'none' as an additional value
that evaluates to false:
http://dev.w3.org/csswg/mediaqueries/#mq-boolean-context

So as long as 'off' is replaced by 'none', then these queries will
work fine in boolean context without changing to integers.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

Received on Wednesday, 11 December 2013 03:51:41 UTC

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