Re: Targeting CSS3 only (evil?), either with pseudoclass or an extra syntax for properties.

Emrah BASKAYA wrote:
> On Sat, 2 Apr 2005 20:23:53 +0100 (BST), David Woolley 
> <david@djwhome.demon.co.uk> wrote:
> 
>>> However, as much as some will hate me for this, I'd really
>>> like to have a null pseudo-class that targets css3 capable
>>> agents only, e.g. p:css3 {} ,
>> 
>> Variations on this come up frequently.  The problems are:
> 
> You are entirely correct. However, a dummy css3 pseudo class may
> give authors an easy transition to getting their things done with
> new CSS3 features while providing something useable for the old
> generation and may solve the degrade problems for style sheets
> using new CSS3 features. One example would be:

If there isn't a strict requirements for UA before supporting :css3 
pseudo class, the feature has no use.

> .sidenote { border: 2px dotted red; padding: 5px; /* no need for
> a large padding */ border-radius: 15px; /* old agents do not
> undestand anything, so no problem here */ }
> 
> .sidenote:css3 { padding: 15px 5px; /* So contents start below
> the rounded circle border */ }

How do you know that UA supports "border-radius: 15px" if it 
supports :css3? Please, see the archives for more discussion about 
this issue.
http://lists.w3.org/Archives/Public/www-style/


A more general solution to this problem looks like

/* legacy support here: */
.sidenote { padding: 5px; }

/* apply nothing in this part if even a single property is not 
supported: */
@require-all-properties-supported /* or any other name */
{
	.sidenote { border-radius: 15px; padding: 15px 5px; }
}

Examples of this idea can be found from the archives, for example:
http://lists.w3.org/Archives/Public/www-style/2004Dec/0084.html

This feature requires that UAs would make conservative claims about 
supported features, too. Some believe that it wouldn't be the case.

The problem you're trying to solve isn't querying for a single 
(un)supported property but you really want to query support for 
combination of multiple properties. You might be even querying for 
support of multiple selector types so perhaps you want

@require-all-properties-supported
@require-all-selectors-supported
@require-all /* the above and all possible new @require-features 
combined */

-- 
Mikko

Received on Monday, 4 April 2005 08:36:34 UTC