Re: Feature queries

On Dec 8, 2009, at 11:48 PM, fantasai wrote:

> My proposal is two syntaxes. The first is an at-rule, which is handy if
> part of the style sheet depends on a major CSS feature such as Tempate
> Layout.
> 
>  @supports ( declaration-block ) {
>     ruleset
>  }

I like it. Of course, I am one to say publicly that browser detection is useful (which I know is contentious). Like this:

	input#userID  { background-image: url(images/label-UserID.png); }
	@supports ( -webkit-box-reflect:below ) {
	    	/* webkit UAs only: */
	    	/* (nothing to do with box-reflect) */
		input#userID  { background-image: none; }
	 }
	input:focus {background-image: none; }

If we could also test attribute support, then it would be better (and less contentious, probably):

	input#userID  { background-image: url(images/label-UserID.png); }
	@supports [placeholder="User ID (required)"] {
	    	/* anything that support's Safari's placeholder attribute: */
		input#userID  { background-image: none; }
	 }
	input:focus {background-image: none; }

And of course, there is also this:

	@supports ( color:#000 ) {
	    	/* newer UAs only!! (post-2010 or whatever): */
	 }

Received on Thursday, 10 December 2009 16:29:27 UTC