Re: [css3-media-queries] More granular conditional logic

On 3 Feb 2011, at 01:31, Boris Zbarsky wrote:

> On 2/2/11 6:01 PM, Antony Kennedy wrote:
>> But what if I want to target browsers that still support the screen media type, but do *not* support -webkit-transform-3d?
> 
> Then you discover that making a media query out of -webkit-transform-3d is not a good way to make it detectable?  ;)

Which is a shame - because it's the only pure CSS method. Unless you know another?

>> I appreciate we want to keep the syntax simple, but conditional logic ought to be intelligent enough to handle these kinds of statements.
> 
> To be able to handle these kinds of statements you need to define a syntax that:
> 
> 1)  Can be parsed without knowing anything about this thing you don't support.

Currently, if a media feature is not known, the entire media query evaluates to "not all". This does not seem a very future-proof methodology. It would make more sense for that single media feature to evaluate to zero - i.e. false. Negating that with a local "not" would work well.

> 2)  Is guaranteed to be a boolean support check.

This is true. Perhaps something like:

@media screen and (supports:property)

and

@media screen and (doesnotsupport:property)

…works better? This gives browser vendor a clear system to hook into rather than creating their own media features and paves the way for targeting future features that have not made their way into the spec.

> Again, it's not clear to me that trying to shoehorn support checks into media queries is the right thing.

I would be interested to know anyone else's approach that could be implemented in pure CSS.

A

Received on Thursday, 3 February 2011 01:57:59 UTC