W3C home > Mailing lists > Public > www-style@w3.org > December 2009

Re: Feature queries

From: Brad Kemper <brad.kemper@gmail.com>
Date: Thu, 10 Dec 2009 08:28:47 -0800
Cc: www-style@w3.org
Message-Id: <70936FCF-643C-4685-8BD2-00A7DEC14A35@gmail.com>
To: fantasai <fantasai.lists@inkedblade.net>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 03:47:12 GMT