W3C home > Mailing lists > Public > www-style@w3.org > January 2012

Re: Proposal: Detecting JavaScript with Media Queries

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 3 Jan 2012 13:03:49 -0800
Message-ID: <CAAWBYDD5r=yHoMm1EknA-awPhgOj2DpHCZCogL8+nTCAUbo4cQ@mail.gmail.com>
To: "Nicholas C. Zakas" <standards@nczconsulting.com>
Cc: www-style@w3.org
On Tue, Jan 3, 2012 at 12:47 PM, Nicholas C. Zakas
<standards@nczconsulting.com> wrote:
> I'd like to propose adding "script" support for media queries, so you can write queries such as:
>
> @media screen and (script) {
> ...
> }
>
> @media screen and not (script) {
> ...
> }
>
> This way, we'd never again have to use of these silly JS-based hacks just to change the appearance when JavaScript is enabled or disabled.
>
> Thoughts?

Sounds pretty good.  The JS-based hacks are simple and easy, but
having this be a media query lets us keep our selectors simpler, and
lets the browser avoid attempting to match the other set of rules at
all.

~TJ
Received on Tuesday, 3 January 2012 21:28:59 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:48 GMT