Re: [WSG] Say no to CSS hacks with branching techniques
From: James Ellis [EMAIL PROTECTED] 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. - That's not true, James. Don't take this the wrong way, but you shouldn't let your love of standards and your disdain for Microsoft cloud your vision. Conditional Comments were not included in IE as a means for fixing CSS bugs. They are merely a way of filtering code for different versions of IE and have been used prolifically in IE-baased intranet apps. But it is perfectly suited as a failsafe way of addressing CSS bugs and as such is a feature that all browsers might consider using because, in the real world, no browser can ever be assured of being 100% bug free across all versions. I believe it's been a topic for discussion on the W3C lists. Whether other browser developers will adopt similar features is anyone's guess, but it would be an intelligent move. Al Sparber PVII http://www.projectseven.com Designing with CSS is sometimes like barreling down a crumbling mountain road at 90 miles per hour secure in the knowledge that repairs are scheduled for next Tuesday. ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] Say no to CSS hacks with branching techniques
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 **
Re: [WSG] Say no to CSS hacks with branching techniques
Thierry In what arcane alternate reality do comments drive code? You are still talking about a hack. How is using this different to parsing a User Agent string? different method but same result. Adding to this, it's not a valid way of writing your code, as mentioned on another thread. The validator may give you a tick but that's only because it's doing the right thing here and ignoring the comments. Just because the validator gives it a tick doesn't mean the application is written well. The subject of the article is pretty apt, I'd tend to agree on that point. Cheers James Also: IE7 will probably have the same Layout-mess (according to my sources), but may need a different fix in order to avoid an even larger mess. It's all there...So what?! IE versions since v5 parse Conditional Comments. IE7 is not hereyet and we already know that it has a (reliable) built-in filter. Isn'tgreat?!;) Thierry | www.TJKDesign.com
Re: [WSG] Say no to CSS hacks with branching techniques
Hi James, Adding to this, it's not a valid way of writing your code, as mentioned on another thread. AFAIK, the discussion you're referring to didn't take us anywhere. It has been said that Michael Landis summed up the thread pretty well saying: I think we're getting very close to a debate on personal beliefs and preferences (the importance of browser support versus the importance of clean code). PPK, who I believe is a clean code advocate, says it's fine to use CCs: http://www.quirksmode.org/css/condcom.html (I'm surprised he calls them CSS hacks though) As a side note, Googling Conditional Comments are evil doesn't return anything... yet! ;) Cheers, Thierry | www.TJKDesign.com ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] Say no to CSS hacks with branching techniques
On 10/9/05, Thierry Koblentz [EMAIL PROTECTED] wrote: That's totally irrelevant. If 2 days ago you knew your article was flawed then why posting a link to it? I only mentioned it because it was published exactly 365 days earlier on a very similar topic (linking CSS to html files). I was amused by this fact. Lets not get so deep, eh people? :)
Re: [WSG] Say no to CSS hacks with branching techniques
Thierry - Umm... the first result: http://www.google.com/search?hl=enq=conditional+comments+are+evilbtnG=Searchmeta= is http://lists.w3.org/Archives/Public/www-style/2005Apr/0027.html 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. Feel free to use your conditional comments, I'm not going to stop you, but don't pass it off as good programming. Check out the HTML 4 spec on comments : http://www.w3.org/TR/html401/intro/sgmltut.html#idx-HTML for more info. Thanks James On 10/10/05, Thierry Koblentz [EMAIL PROTECTED] wrote: As a side note, Googling Conditional Comments are evil doesn't returnanything...yet! ;)
Re: [WSG] Say no to CSS hacks with branching techniques
James Ellis wrote: 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. However, as opposed to coloured scrollbars and such, they are completely invisible to standards compliant browsers. Feel free to use your conditional comments, I'm not going to stop you, but don't pass it off as good programming. It's not good in a standards purist sense, but in a rubber meets the road real world best practice usage sense, they're on par with CSS based import hacks and the like. Wouldn't say that either technique is better than the other... -- Patrick H. Lauke __ re·dux (adj.): brought back; returned. used postpositively [latin : re-, re- + dux, leader; see duke.] www.splintered.co.uk | www.photographia.co.uk http://redux.deviantart.com __ Web Standards Project (WaSP) Accessibility Task Force http://webstandards.org/ __ ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] Say no to CSS hacks with branching techniques
James, 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. To be honnest with you I prefer the don't pollute the markup speech. IMHO, MS is evil is a weak angle. Feel free to use your conditional comments, I'm not going to stop you, but don't pass it off as good programming. Check out the HTML 4 spec on comments : http://www.w3.org/TR/html401/intro/sgmltut.html#idx-HTML for more info. I'm using a hack that relies on a browser's feature. You prefer to use CSS hacks that rely on browsers' *bugs*. Is that better programming? Thanks, You're welcome, Thierry | www.TJKDesign.com ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] Say no to CSS hacks with branching techniques
Andrew Krespanis wrote: On 10/8/05, Thierry Koblentz [EMAIL PROTECTED] wrote: I'm sorry, but this doesn't make sense at all. Or is there an important detail I'm missing? ;) Yes, you're missing the part where this was written over 12 months ago That's totally irrelevant. If 2 days ago you knew your article was flawed then why posting a link to it? I have 1 or 2 articles on my site that I'm not proud of (and too lazy to delete or edit), but I would never post their URIs ;) by someone who had only built 3 sites and wanted to try and help other beginners navigate the 'minefield of pain' that is starting out with CSS. I absolutely should write an updated version of my article, I don't deny much of what is discussed is now outdated.That said, I have an archive of nearly 700 emails thanking me for the methods outlined in that article alone, so I have no regrets what so ever about publishing and promoting those techniques (at the time, anyway). In your original post, when you pointed out the issue about the value of the media attribute, I just said: [I have] absolutely no excuse for that one... There is no need to look for an excuse... Sometimes ooops! is good enough. It's really no big deal ;) Let's discuss your article in 12 months and see if you still feel the same ;) I didn't look for your article, it's you who brought it up ;) Regards, Thierry | www.TJKDesign.com ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] Say no to CSS hacks with branching techniques
Gunlaug Sørtun wrote: I have yet to see a good browser with solid CSS support, so solid doesn't mean flawless. I am not that naive ;) I don't think we can say completely no to CSS hacks anytime soon. But of course; this depends on how we define hacks, so it's well worth trying. That sentance leaves too many doors opened so I won't go there, but FWIW, I don't agree with you ;) I find the extensive use of @import from within documents a bit code-heavy and limiting. Would like to see variations that'll lead to the same, more or less, hack-free results. I prefer to do as much @import branching as I can from within the stylesheets, and use link elements in the document-head. One set of If you do this as a means to serve different rules to different browsers then you end up using CSS filters inside the style sheets. Also, IMHO, importing sheets through styles sheets doesn't help maintainability since rules in the sheet override rules in the imported styles sheets. It's one more layer to the cascade, redundant rules, etc... I believe this technique is good to split a sheet into different sections though (layout, etc.). @import in CSS is easier to maintain than having them spread across several hundred pages. ? Don't you use Includes? Regards Thierry | www.TJKDesign.com ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] Say no to CSS hacks with branching techniques
Gunlaug Sørtun wrote: That sentance leaves too many doors opened so I won't go there, but FWIW, I don't agree with you ;) Should there be a 'dis' in that sentence? Or? :-) ;) I like the chaotic mess we get when all doors are opened. Leaves me with a lot more options. I know. That's powerful stuff, it allows one to rebound ;) FWIW: I define all workarounds for browser-bugs and weaknesses as hacks - including 'CC', 'filtering' and 'branching'. Guess that's why I'm not too impressed by the present quality of browsers and other software. Been at it for too long, I guess. If this is your definition of hacks, then I can't disagree... But for me, hacks are any filters that rely on browsers' *bugs* rather than documented features. If you do this as a means to serve different rules to different browsers then you end up using CSS filters inside the style sheets. Yes. For dead browsers. Other browsers won't/shouldn't need any. :-) You mean the good ones with solid CSS support? ;) - IE/Mac is (maybe) filtered in on top of the base stylesheet. - Older IE/win are (maybe) filtered in in a 'lte IE6' stylesheet. - Other dead browsers are filtered out and/or forgotten. (May use the javascript option just for fun, but no one has requested such a solution for real.) - IE7 will probably need its own branch (see below). Comment on article: It's written in a title-attr., but note that the 'Layout' concept has to be understood somewhat, since the fix can be deadly if misplaced. Besides, it is not just _one_ fix that's needed in many cases. The dis is back. IMO, hasLayout is a tough concept to grab. I think experiencing the result of the implementation of this fix is enough feedback for most people. It works or it doesn't. AFAIK, understanding the concept doesn't make this fix more successful ;) I'm not saying people shouldn't be curious though... Also: IE7 will probably have the same Layout-mess (according to my sources), but may need a different fix in order to avoid an even larger mess. It's all there... So what?! IE versions since v5 parse Conditional Comments. IE7 is not here yet and we already know that it has a (reliable) built-in filter. Isn't great?! ;) Thierry | www.TJKDesign.com ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] Say no to CSS hacks with branching techniques
Thierry Koblentz wrote: IMO, hasLayout is a tough concept to grab. I think experiencing the result of the implementation of this fix is enough feedback for most people. It works or it doesn't. You sure got that wrong. Please, don't repeat it to others - they may believe you. AFAIK, understanding the concept doesn't make this fix more successful ;) I can agree on that point, but for a different reason. The 'concept' *is* easy to understand, and fixes *should* either work or not work. However, it is not that simple, as one also have to know (not understand) something about the many bugs the MS-staff managed to build into that 'concept', if some degree of success with *any combination* of fixes should be assured. The 'link-title comment' in your article seems to discard this simple fact completely, and that's not helpful to most people. IE7 is not here yet and we already know that it has a (reliable) built-in filter. Isn't great?! No, it means they are able to release yet another broken browser in need of fixes, by design. Nothing great about that. The subject of your article won't suffer though. :-) Georg -- http://www.gunlaug.no ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] Say no to CSS hacks with branching techniques
Andrew Krespanis wrote: On 10/7/05, Thierry Koblentz [EMAIL PROTECTED] wrote: I would appreciate your feedback so I can improve this article: http://www.tjkdesign.com/articles/branching.asp Sure, but I'm in a hurry so please excuse me if I'm a bit short with my reponse :) media=all is a pretty presumptuous piece of advice; especially since there doesn't appear to be any instruction for beginners as to the implications of using media=all. Duh! Absolutely no excuse for that one... ;( I couldn't agree more with what you're trying to achieve, but I think there are still some important details missing :) That's why I asked for feedback. I *knew* there was room for improvment ;) I've added your suggestions as well as Christian's (regarding FOUC). Funnily enough, I published something rather similar exactly one year ago today: http://leftjustified.net/journal/2004/10/07/css-negotiation/ Similar? I'm not sure ;) The title of my post says it all: say no to CSS hacks So to be honnest with you, I find your approach very *confusing*. You're using a CC without specifying a version vector in the conditional expression (saying it is to fix IE6) and then you come up with 2 different *hacks* to target IE 5 and 5.5 PC (what about IE 5 Mac BTW?). Actually, what you say is: My favourite method is using Tantek’s IE5 and IE 5.5 band-pass filters in the IE only stylesheet to import a separate file for that browser only. But if you believe a CC is good enough to take care of IE6, then why using these 2 hacks for IE 5? I'm sorry, but this doesn't make sense at all. Or is there an important detail I'm missing? ;) Cheers, Thierry | www.TJKDesign.com ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] Say no to CSS hacks with branching techniques
On 10/8/05, Thierry Koblentz [EMAIL PROTECTED] wrote: I'm sorry, but this doesn't make sense at all. Or is there an important detail I'm missing? ;) Yes, you're missing the part where this was written over 12 months ago by someone who had only built 3 sites and wanted to try and help other beginners navigate the 'minefield of pain' that is starting out with CSS. It's all well and good to say that's so outdated, what the heck were you thinking and you're right -- I don't use the IE filter methods anymore and I usually cater for more alternative media from the outset. I absolutely should write an updated version of my article, I don't deny much of what is discussed is now outdated.That said, I have an archive of nearly 700 emails thanking me for the methods outlined in that article alone, so I have no regrets what so ever about publishing and promoting those techniques (at the time, anyway). Let's discuss your article in 12 months and see if you still feel the same ;)
Re: [WSG] Say no to CSS hacks with branching techniques
Hi Andrew, With due respect for your article (everything gets outdated status pretty fast on the Internet... no) you was the one brought your article into the debate ;) Peace Kim It's all well and good to say that's so outdated, what the heck were you thinking and you're right -- I don't use the IE filter methods anymore and I usually cater for more alternative media from the outset. ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] Say no to CSS hacks with branching techniques
Thierry Koblentz wrote: I would appreciate your feedback so I can improve this article: http://www.tjkdesign.com/articles/branching.asp The idea is good, but it's a bit incomplete at the moment. I have yet to see a good browser with solid CSS support, so I don't think we can say completely no to CSS hacks anytime soon. But of course; this depends on how we define hacks, so it's well worth trying. I find the extensive use of @import from within documents a bit code-heavy and limiting. Would like to see variations that'll lead to the same, more or less, hack-free results. I prefer to do as much @import branching as I can from within the stylesheets, and use link elements in the document-head. One set of @import in CSS is easier to maintain than having them spread across several hundred pages. My approach is also to style all media separately - including the use of @media, and use as few cross-media styles as possible. That's another way to avoid both hacks and browser-bugs. regards Georg -- http://www.gunlaug.no ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
[WSG] Say no to CSS hacks with branching techniques
I would appreciate your feedback so I can improve this article: http://www.tjkdesign.com/articles/branching.asp Regards, Thierry | www.TJKDesign.com ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] Say no to CSS hacks with branching techniques
On 10/7/05, Thierry Koblentz [EMAIL PROTECTED] wrote: I would appreciate your feedback so I can improve this article: http://www.tjkdesign.com/articles/branching.asp Sure, but I'm in a hurry so please excuse me if I'm a bit short with my reponse :) Congratulations! Now your file is ready for prime time. In the markup, below the title element, write the following: style type=text/css media=all @import url(/css/basic.css); /style media=all is a pretty presumptuous piece of advice; especially since there doesn't appear to be any instruction for beginners as to the implications of using media=all. Can your PDA fit a 800px wide fixed width layout? What about your phone? Nor can mine. ..and what use is visual style to an audio-based browser? ;) cursor:hand This is only needed for IE 6. Perhaps worth adding this detail? Have you tested that media=print on a link elements has higher precedence that media=all on style in all your supported browsers? I couldn't agree more with what you're trying to achieve, but I think there are still some important details missing :) Funnily enough, I published something rather similar exactly one year ago today: http://leftjustified.net/journal/2004/10/07/css-negotiation/ cheers, Andrew. -- http://leftjustified.net/
[WSG] Say no to CSS hacks with branching techniques [the legible version]
I must apologize for the jumbled mess that was my previous response to this thread. I have been informed that my posts come through with no line breaks and encrypted nonsense at the end. This is caused by the CustomizeGoogle firefox extension; more specifically, the 'Secure Gmail' option. I have uninstalled the extension and I'm re-posting my response on the grounds that when a copy of it was sent back to me I couldn't understand it at all, even though I had only written it 30 minutes prior. Again, sorry for creating excess noise, Andrew. -- Forwarded message -- From: Andrew Krespanis [EMAIL PROTECTED] Date: Oct 7, 2005 10:26 AM Subject: Re: [WSG] Say no to CSS hacks with branching techniques To: wsg@webstandardsgroup.org On 10/7/05, Thierry Koblentz [EMAIL PROTECTED] wrote: I would appreciate your feedback so I can improve this article: http://www.tjkdesign.com/articles/branching.asp Sure, but I'm in a hurry so please excuse me if I'm a bit short with my reponse :) Congratulations! Now your file is ready for prime time. In the markup, below the title element, write the following: style type=text/css media=all @import url(/css/basic.css); /style media=all is a pretty presumptuous piece of advice; especially since there doesn't appear to be any instruction for beginners as to the implications of using media=all. Can your PDA fit a 800px wide fixed width layout? What about your phone? Nor can mine. ..and what use is visual style to an audio-based browser? ;) cursor:hand This is only needed for IE 6. Perhaps worth adding this detail? Have you tested that media=print on a link elements has higher precedence that media=all on style in all your supported browsers? I couldn't agree more with what you're trying to achieve, but I think there are still some important details missing :) Funnily enough, I published something rather similar exactly one year ago today: http://leftjustified.net/journal/2004/10/07/css-negotiation/ cheers, Andrew. -- http://leftjustified.net/