Re: Proposal: useragent at-rule

On 3/29/04 2:03 PM, "Dave Shea" <dave@mezzoblue.com> wrote:

> 
> Pardon my delayed intrusion here.
> 
> In the thread titled "Proposal: version at-rule" from a few days back, I
> believe Chris Moschini started touching on some real problems that may
> arise from *not* introducing some form of version-specific control.
> 
>> But the discussion continues because this problem is very important to
>> developers - all these inevitable "buts" take a lot of time to sort out and
>> create very ugly hacks to work around, which in turn can cause their own
>> problems.
> 
> I believe this is the crux of it. In a year or three I will no longer
> need to support IE5. I'll be perfectly content at that point to serve
> unstyled markup to it, the same as many of us do now with NN4.x:
> 
>      <style type="text/css">
>        @import "filename.css";
>      </style>
> 
> Except that the mechanism to hide CSS from IE5 isn't quite so tidy as
> the @import rule that worked in NN4.x. I'd have to go to ridiculous
> lengths with the Box Model Hack to get it to work.

That's why there's the Mid-pass filter [1] which I described as a possible
alternative to the Box Model Hack, during my presentation on CSS at SXSW
[2].  See also my point about avoiding hacks if at all possible, if not,
minimizing hacks and keeping them as far from the content as possible.

> And that's just IE5. What about Opera 5, Safari 0.85, Netscape 6, etc.
> etc.? And what about browsers that we (the development community) don't
> discover hacks for?

As someone else pointed out, don't waste time doing hacks for browsers of
less than n% of your audience (pick you n accordingly).  Are any of those
browsers (except IE5) even 0.1% of your audience?

> Discouraging version-specific control is what has created a need for CSS
> hacks in the first place; the reality is that developers deal with
> flawed browsers.

Unfortunately the alternative of user-agent switching is far worse, as
others have already pointed out, it has resulted in the ridiculous
user-agent names that browsers have today.

Tantek

[1]
 http://tantek.com/CSS/Examples/midpass.html

[2]
 http://tantek.com/presentations/2004sxsw/css.html

Received on Monday, 29 March 2004 19:49:57 UTC