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

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