Re: @media and browsers conditional statments

Francois Remy wrote:
> What about a @media browser-base filtering of CSS ?
> It should be greater than hacks to repair browsers bugs.
>  
> What are you thinking of it ?
I'm sure this has already been belabored to death, but the primary 
problem with sniffing in general is that it takes a few people to lock 
out certain browsers in key sites for developers to decide "maybe we 
should pretend to be XXX," and we get the mess that is U-A strings all 
over again.

Also, there are probably going to be a fair number of small developers 
wondering why

@media (firefox) or @media (ie) doesn't seem to work. Look at the people 
sniffing for "Firefox" in U-A strings instead of "Gecko" if you want an 
example.

Finally, there is the problem I have seen mentioned elsewhere with 
respect to version testing. John Doe doesn't necessarily know if IE 7 
fixes some buggy behavior in IE 6. So should he do @media (trident <= 6) 
or @media (trident) ? Either way, he has a lot of work to do when IE 7 
comes out.

In an ideal world (okay, nearly ideal), the way to test would be 
@has-feature(display:magic-type) or something similar; in practice, this 
fails miserably since you don't know how buggy the support for 
display:magic-type.

There is no easy answer to solving the dichotomy of implementations out 
there, especially since your consumers are not going to complain to you 
about bugs in CSS but to their browsers. I have bad omens about 
supporting feature or UA sniffing, though...

-- 
Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth

Received on Saturday, 9 August 2008 22:02:42 UTC