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

On Apr 4, 2005 8:16 PM, Laurens Holst <lholst@students.cs.uu.nl> wrote:
> 
> Browser sniffing is the BAD solution, which unfortunately is sometimes
> necessary. What I mean with this is, with browser sniffing, you create
> code with loads of hacks for IE6, but when IE7 is released, there is no
> way to tell what it will support. So either you check for IE6 and IE7 is
> fed your 'standards compliance' version which will probably still not
> work, or you check for IE in general (although history tells us that
> each version requires different hacks) and IE7 is fed the hacks for IE6
> and misrenders things as well.

For all those who do look at browser sniffing as a necessary evil,
keep in mind that "!required" (or any of the close relative proposals)
would allow you to do this as a hack. If you desperately needed to
apply a style only to IE, just mark an IE only CSS property as
!required. Similarly if you're hacking around a mozilla bug, mark as
!required any of the -moz- extensions (and so on for -o-, -khtml-,
-apple- and so forth).

Again, I'd like having blocks of style rules since /if/ something
terrible happened and I did need to do a big block of correction for
Browser X, I could put those corrective styles into a @group { }, then
"!require" a proprietry property in the first style only
("-browserx-dancing-monkeys: #00F !required") and write the rest of
the styles in that group without bloat/pollution, still knowing that
they'll only be applied to Browser X.

As most here can probably tell, I'm really rather keen on !required,
but I don't want to repeat myself over and over. I fear many are
looking in their inbox thinking "Oh God, not again", so I'll refrain
from any more. I do think that the "Browser Sniffing" last resort is
comfortably covered by a syntax which works with a more "embrace new
CSS" intent, rather than a purely "fix-faulty-browser" one.

-- 
http://www.ben-ward.co.uk

Received on Monday, 4 April 2005 20:43:42 UTC