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

[css4-mediaqueries] Vendor media queries

From: Lea Verou <leaverou@gmail.com>
Date: Wed, 25 Jan 2012 22:43:32 +0200
Message-ID: <4F206974.6030702@gmail.com>
To: www-style list <www-style@w3.org>
Since each vendor already has their own prefixes, I was thinking it 
could be useful to have a media query about that. It would greatly help 
authors overcome implementation inconsistencies, especially in new 
and/or experimental features where these are common. Sometimes CSS’ 
graceful error handling is just not enough for that.

Each UA could recognize more than one such identifiers. The syntax could 
be like (commas = OR):

@media (user-agent: moz, webkit) { ... }

An argument against this could be that it encourages bad practices as 
authors would jump to the easy solution of writing separate CSS for each 
UA. However, a quick look at most big modern websites reveals that many 
are already emulating this feature through JavaScript & CSS classes anyway:
- twitter: Uses classes like webkit on <body>
- facebook: Uses classes like safari4
- Yahoo: Uses classes like ua-wk ua-mac
- Windows Live: Uses classes like Safari SF_Mac SF_M16 SF_D0 Full RE_WebKit

This practice is slow, as the UA has to parse every rule, whether it's 
about it or not and it requires descendant selectors which are not 
exactly famous for their speed. With a media query, the UA could ignore 
the entire thing.


-- 
Lea Verou (http://lea.verou.me | @LeaVerou)
Received on Wednesday, 25 January 2012 20:44:09 GMT

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