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

Re: Proposal: Detecting JavaScript with Media Queries

From: Florian Rivoal <florianr@opera.com>
Date: Wed, 04 Jan 2012 10:33:20 +0100
To: www-style@w3.org
Message-ID: <op.v7jzhuzp4p7avi@localhost.localdomain>
On Tue, 03 Jan 2012 23:43:08 +0100, Nicholas C. Zakas  
<standards@nczconsulting.com> wrote:

> On 1/3/2012 1:03 PM, Tab Atkins Jr. wrote:
>> 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
> Yup, that was exactly my goal. So...how can we make this happen? :)

This sounds like a good idea to me as well, and I recently became
co-editor of the Media queries spec, so it is up to me (and Sylvain)
to make this happen now. Media queries level 3 is already pretty stable,
so I don't think it makes sense to try and add this here, but this
is certainly something that I'll be happy to add in level 4.

  - Florian
Received on Wednesday, 4 January 2012 09:33:55 GMT

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