James,
I can see where you're coming from, and I'm all for the programming
purity you're advocating, but I want to stick my hand up in support of
Thierry's position here. In fact, I was in the process of assembling
all these filters myself when he posted his link to this list, so I'm
grateful to him for saving me the extra work ;-)
[...]
is http://lists.w3.org/Archives/Public/www-style/2005Apr/0027.html
The last comment on CCs there shows the conflict of hack usage most
clearly: "Their use encourages the practice of coding for specific
browsers, which goes against the whole purpose of standardisation! CSS
hacks do too, but they don't pollute the document markup and they're
more acceptable if used in moderation and when absolutely necessary to
maintain accessibility."
CSS hacks are pollution too, even in a style sheet. (And conditional
comment usage for styling purposes need never be anything other than
'moderate'). Even the best hack - "star html," let's say - is worse
than a CC imho, because sure, it's "valid," but it's not the least bit
standard, and locating these hacks in the same place as standard rules
only blurs the distinction between the two. CC's not only let me
_isolate_ all the hacks from my standard style rules, they also let
anyone else on the team (including novice coders) debug display
problems *using only standard code* in a separate file. No-one needs to
learn or implement anything other than CSS standards so, in a sense,
you could say that conditional comments help teach good CSS. And the
only 'semantic' content that's been changed in the (X)HTML is a
reference to a file ... which is neither meaningful, nor part of the
document content, or it wouldn't be in the head. I just don't see the
downside (Andrew's mention of the extra few lines of code
notwithstanding ... the hacks aren't made of helium, after all ;-)
One of the functions of this list and group is to implement best
practices using W3C standards based development. These conditionals
you talk about are a Microsoft addition to workaround bugs in their
software (what happened to fixing the bugs?), like coloured scrollbars
and DirectX calls in CSS instead of correct PNG alpha support.
The bugs will never be fixed, the conditional comment support to work
around them will never change. It's as good as we ever get in this
game.
Feel free to use your conditional comments, I'm not going to stop
you, but don't pass it off as good programming.
Well, I am trying to pass it off as just that. Feel free to argue the
point further if I you remain unconvinced.
Check out the HTML 4 spec on comments :
http://www.w3.org/TR/html401/intro/sgmltut.html#idx-HTML for more
info.
And check out the results of following only w3c specs in the browser
most people still (inexplicably) use :-) It's just not professionally
acceptable to deliver that to clients, as you well know. And I think
CSS filters, as Thierry has listed them, while certainly outside the
letter of the specs (and proper programming practice), are quite in
keeping with their spirit.
Cheers,
Mike
******************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************