Re: Proposal: useragent at-rule

Various folks wrote:
>>>I use server-side scripting to identify UAs and then modify the 
>>>CSS using PHP -
>>>not the prettiest solution, but it works.
>>
>>So UA strings, while not wonderful, *are* usable.
>
>Usable, yes, but not good to be part of a standard.

What fundamental purpose would @useragent serve in the spec?  The 
goal of the spec is to convince all UAs to achieve compliance so 
authoring becomes as easy as possible.  Thus it seems the spec has to 
be designed to try to render that rule entirely useless.  This seems 
like a patch applied to a future version to cure a current problem. 
As such, I have trouble envisioning it as a working solution, and if 
implemented it seems as though it would still make authoring just as 
difficult as it is right now.

On the other hand, I don't see that there would be any harm in 
implementing an @version rule, so that authors can declare which 
version of CSS they are supporting.  This follows the Javascript 
model, at least to some extent.  Such a declaration would allow the 
future development of the spec in a direction that is incompatible 
with current implementations, should that prove to be desirable at 
some point.  A version declaration might also give authors the option 
to specify that the user agent could use the rules in the version 
block as a supplement to other rules, or as an exclusive substitute 
for them.

After several CSS versions, I could imagine, e.g.:

/* current generation browsers see generic rule blocks here */
@version (3, exclusive) {
   /* rules aimed at CSS version 3 implementations */
   /* generic rule blocks would not be applied */
   @version (4, inclusive) {
     /* enhancements for CSS version 4 capable browsers */
     /* version 3 rules would also apply, but not */
     /* generic rule blocks, since the version 4 rule */
     /* is itself contained inside an exclusive block */
   }
}

I don't know if this would be too difficult to implement (certainly 
it would bring up progressive rendering issues in this form, at 
least), but I can certainly imagine it being useful to authors.  And 
it makes authoring easier, because it could be entirely ignored by 
authors if they didn't want to use advanced features.  It also 
partially addresses some of the issues @useragent is supposed to 
cover, but does it in a more consistent, spec-centric way, in my view.

-- 

-Adam Kuehn

Received on Tuesday, 30 March 2004 13:05:39 UTC