[WSG] Trimming the fat from CSS
Does everyone else on the list do this? For the sake of 11k that is cached on the first page load it seems a little drastic. I do programming work as well as markup and the indentation/formatting of the code is very important in producing readable code. If it was only me looking at the CSS then fine, but in a team situation producing CSS formatted like this could make human reading a lot harder and thus slow production time. I can understand if you use TopStyle to do this automatically but I just thought a note of caution/consideration to others reading this that may feel it's a thing all good CSS developers must do. Personally I'd prefer to leave my CSS formatted as is and shave the k's off images used, etc. Then if I need to hand the stylesheets over to someone they are more usable. Nick Anyway as for your CSS, you have a lot of fat that can be trimmed from that as well (no need to repeat the font families if ya put them in the body style) You do not need the ; after the last attribute in each style (You can remove the returns and have your list go horizontal instead of vertical) Once all done remove all spaces between the commas and the semi-colons and remove the rest of the returns and have one LONG line all of these together will trim A LOT off the size of the stylesheet mine by itself in a editing state with comments is over 18k but the version I put on line is under 7k. It dont look as pretty when it is opened and is harder to read by a human, but it is a smaller file and reads faster by a machine. * 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] Constructive Criticism please
theGrafixGuy said, You do not need the ; after the last attribute in each style I know this is technically true (browsers will accept it) but I understood that good coding practice is to put the semicolon even after the last attribute. Anyone else know anything about this? -Hugh Todd * 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] Trimming the fat from CSS
Any web server worth it's salt will gzip compress static files, which makes trimming all the whitespace a bit pointless. Ditto with any crazy-assed class naming scheme you come up with to make things smaller. I learnt most of what I know about HTML, CSS JS from viewing the source of pages that had something I thought was cool, so I think it's kinda nice to make my stuff as readable as possible for anyone doing the same these days. Also helps when I come back to make changes 6 months later wonder WTF things do :) [EMAIL PROTECTED] wrote: Does everyone else on the list do this? For the sake of 11k that is cached on the first page load it seems a little drastic. I do programming work as well as markup and the indentation/formatting of the code is very important in producing readable code. If it was only me looking at the CSS then fine, but in a team situation producing CSS formatted like this could make human reading a lot harder and thus slow production time. I can understand if you use TopStyle to do this automatically but I just thought a note of caution/consideration to others reading this that may feel it's a thing all good CSS developers must do. Personally I'd prefer to leave my CSS formatted as is and shave the k's off images used, etc. Then if I need to hand the stylesheets over to someone they are more usable. Nick -- Lindsay Evans. Developer, Red Square Productions. [p] 8596.4000 [f] 8596.4001 [w] www.redsquare.com.au * 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] Trimming the fat from CSS
Yeah pretty well what I was thinking I mean in practice CSS files are often shared and the very process of using CSS based layouts v's tables already trims a huge load off the page size anyway. It just seemed almost scarily ...thorough... to be trimming the stylesheet in this way as well. Though as I said if you have an auto trimmer/de-trimmer then fair enough. Nick Any web server worth it's salt will gzip compress static files, which makes trimming all the whitespace a bit pointless. Ditto with any crazy-assed class naming scheme you come up with to make things smaller. I learnt most of what I know about HTML, CSS JS from viewing the source of pages that had something I thought was cool, so I think it's kinda nice to make my stuff as readable as possible for anyone doing the same these days. Also helps when I come back to make changes 6 months later wonder WTF things do :) * 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] Trimming the fat from CSS
Nick You know what they say... there's anal and then there's anal ;-). I've been programming most of my life and can never figure out these guys that do this. They'll shrink every K they can find white and comments too. But they usually are the same ones that make all the syntax errors and can't remember or find what they did a month ago. Do they ever realize that machines never look at that stuff, and they do their thing at pico speeds. How many pico seconds are there in 100 or so semicolons? Besides machine code speed, then there's required block (fat32 HFS+) and packet size error correction, etc etc etc etc.. blah blah blah Oh and Nick I never do this. As a human, I like code readable. It's worth the extra 5k. Leo On Thursday, April 15, 2004, at 02:06 AM, Nick Lo wrote: Does everyone else on the list do this? For the sake of 11k that is cached on the first page load it seems a little drastic. I do programming work as well as markup and the indentation/formatting of the code is very important in producing readable code. If it was only me looking at the CSS then fine, but in a team situation producing CSS formatted like this could make human reading a lot harder and thus slow production time. I can understand if you use TopStyle to do this automatically but I just thought a note of caution/consideration to others reading this that may feel it's a thing all good CSS developers must do. Personally I'd prefer to leave my CSS formatted as is and shave the k's off images used, etc. Then if I need to hand the stylesheets over to someone they are more usable. Nick Anyway as for your CSS, you have a lot of fat that can be trimmed from that as well (no need to repeat the font families if ya put them in the body style) You do not need the ; after the last attribute in each style (You can remove the returns and have your list go horizontal instead of vertical) Once all done remove all spaces between the commas and the semi-colons and remove the rest of the returns and have one LONG line all of these together will trim A LOT off the size of the stylesheet mine by itself in a editing state with comments is over 18k but the version I put on line is under 7k. It dont look as pretty when it is opened and is harder to read by a human, but it is a smaller file and reads faster by a machine. * The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help * * 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] Trimming the fat from CSS
Jason An even better question is : What kind of irony is it when someone who joins an open standards group considers practicing such anti-open-standards technique? ;-) Leo On Thursday, April 15, 2004, at 02:34 AM, Jason Turnbull wrote: Nick Lo wrote: Does everyone else on the list do this? For the sake of 11k that is cached on the first page load it seems a little drastic I would agree its not going to save much, having readable code is much more important, I wonder if people who do this also remove all spaces/tabs within the html code Jason * The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help * * 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] Trimming the fat from CSS
I happen to be one of those people and I can say that the practice is under utilized by the programming industry as a whole. And I am neither anal nor ANAL, it is simply the method of coding I like to use once I have a page developed to a point I no I will only be touching it up here and there. As I stated previously, I look at it as building a rocket to go to the moon - you want light but solid and reliable. I HATE bloat and that is all the stuff that makes code pretty and easily readable by inexperienced programmers does. If some one wants to review the code they can take the few seconds to do a find } and replace with [return]}[return] find { and replace with [space]{[space][return] find ; and replace with ;[return] [space] [space] [space] [space] find : and replace with :[space] find , and replace with ,[space] And you have the css stylesheet decrunched to the point it is fat pretty again. And with html, PHP and JAVA, I do the same thing wherever possible. I always use this as a challenge to people - build a little 4-page site to play with under the following rules: Less than three http requests per page Uses advanced technologies to make the site visually interesting and is not just plain text. 1 css file - under one packet in size (less than 1160 bytes) Page loads in under 5 seconds on 56k Once you do that than optimize it to be as tiny as possible - how small can you get it? -Original Message- From: Jason Turnbull [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 14, 2004 11:35 PM To: [EMAIL PROTECTED] Subject: RE: [WSG] Trimming the fat from CSS Nick Lo wrote: Does everyone else on the list do this? For the sake of 11k that is cached on the first page load it seems a little drastic I would agree its not going to save much, having readable code is much more important, I wonder if people who do this also remove all spaces/tabs within the html code Jason * The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help * * 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] Constructive Criticism please
Show me an instance where the last semi-colon missing on the last style attribute broke something in ANY modern browser. Good coding practice? Phooey - its a wasteful practice. I suppose CSS shorthand is not good coding practice either. Brian -Original Message- From: Leo J. O'Campo [mailto:[EMAIL PROTECTED] Sent: Thursday, April 15, 2004 12:04 AM To: [EMAIL PROTECTED] Subject: Re: [WSG] Constructive Criticism please Sure Hugh Any good programmer would never leave it off because it is good coding practice. Leaving off the semicolon just because they can, will eventually come and kick them in the butt. And if it doesn't MSIE surely would. Remember the quotes in the old days. Leo On Thursday, April 15, 2004, at 02:13 AM, Hugh Todd wrote: theGrafixGuy said, You do not need the ; after the last attribute in each style I know this is technically true (browsers will accept it) but I understood that good coding practice is to put the semicolon even after the last attribute. Anyone else know anything about this? -Hugh Todd * The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help * * The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help * * 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] Trimming the fat from CSS
On Thursday, April 15, 2004, at 03:20 AM, theGrafixGuy wrote: I HATE bloat You know Brian, for a person who hates bloat, you sure are full of it. ;-) lol Leo * 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] Constructive Criticism please
LOL - what good is paper in space - get rid of it! Use a PDA with LiIon batteries as they are a few ounces lighter than NiCAD or alkaline ;-) and replace the solid plastic pen/pointer with a ultralight hollow carbon fiber replacement weighing much less and costing 1000x as much - also replace the heavy plastic shell of the PDA with a carbon fiber shell weighing 25% or less of the original and again costing 100x as much. -Original Message- From: Leo J. O'Campo [mailto:[EMAIL PROTECTED] Sent: Thursday, April 15, 2004 12:21 AM To: [EMAIL PROTECTED] Subject: Re: [WSG] Constructive Criticism please theGrafixGuy Good coding practice is for classroom, real world you want lean with as little waste as possible. I look at it like a space mission to the moon and every byte is weight - the less weight I have for the structure of the rocket (framework for the site)and still have a solid site, the more room I have for cargo and mission materials (content). Is this why NASA carries all those on-board manuals with them to the moon? Geezz... God help the astronaut that hires you as his efficiency expect. Leo * The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help * * 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] Constructive Criticism please
Kay said What I would do in your situation is hide the css from Netscape 4 completely by using either the media=all attribute on your link tag, or @@import syntax. I actually dont really understand that stuff *cringe with embarrasment* I know i read up on it at some stage but as usual can't remember where to go and find the info now that i need it. Can someone point me in the right direction please. also...Thanks for the nice comments..Kay... i appreciate them Jackie * The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help * * 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] Trimming the fat from CSS
Hi Brian, You seem to be getting jumped on a bit for this and I'd say it's largely a matter of preference so a little pointless to go on at length about. However, you are inviting comment by saying bloat and that is all the stuff that makes code pretty and easily readable by inexperienced programmers does. since Python itself is based on indentation (formatting) and can hardly be called a bloated language nor one for inexperienced programmers. Also the other big point is a stylesheet file is cached on the first page load whereas individual pages and images are often reloaded so arguing about the 7k saved in the CSS file while leaving 1k on every image (I certainly see far more sites with poorly optimised images that could speed things up no end) would be getting one's priorities wrong (not saying you do that just a general point). So in summary it depends where you need to trim. In your workflow you have things narrowed to the degree that you can afford to go to this length but for others this may actually bloat their workflow. Part of standards development I'm sure we all love is the improvement in workflow. Nick I happen to be one of those people and I can say that the practice is under utilized by the programming industry as a whole. And I am neither anal nor ANAL, it is simply the method of coding I like to use once I have a page developed to a point I no I will only be touching it up here and there. As I stated previously, I look at it as building a rocket to go to the moon - you want light but solid and reliable. I HATE bloat and that is all the stuff that makes code pretty and easily readable by inexperienced programmers does. * 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] Constructive Criticism please - NOW IN DISCUSSION
Folks, Discussion of coding practices is all well good, but I think it's getting a bit off topic. If you'd like to continue the discussion, I've setup a thread in the discussion room for it: http://discuss.webstandardsgroup.org/archives/13.htm Please post any further comments there. Thanks. -- Lindsay Evans. WSG Core. * 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] Constructive Criticism please
Ben Smith said: To Kay: how do you eliminate the whitespace that CF processing adds? I could never figure out an easy way to do it reliably.. Well, I use Fusebox, so all my non-display code is tucked away into cfinclude files with cfsilent tags applied liberally. While I know that a few bytes don't make much difference at all, I do tend to remove extra spaces and blank lines when I'm coding. Tidy code, tidy mind? Either that or I'm particularly anally-retentive... K. -- Kay Smoljak http://kay.smoljak.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] Trimming the fat from CSS
I have been accused of that and worse ;-) You should hear what the wife says :-) Brian -Original Message- From: Leo J. O'Campo [mailto:[EMAIL PROTECTED] Sent: Thursday, April 15, 2004 12:31 AM To: [EMAIL PROTECTED] Subject: Re: [WSG] Trimming the fat from CSS On Thursday, April 15, 2004, at 03:20 AM, theGrafixGuy wrote: I HATE bloat You know Brian, for a person who hates bloat, you sure are full of it. ;-) lol Leo * The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help * * 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] Trimming the fat from CSS
Wow.. this is fun... Im really glad i opened up this little can of worms, the list had really been a bit too quiet for my liking today. ;o) But to Brian... you made me think about the size of the css and I have done some of what you said but not all..and even if the code is not absolutely bare bones its a tad more compact than it was before...so thanks for your advice. Cheers Jackie... PS(must be time for an alcholic beverage or three by now) Leo said I HATE bloat You know Brian, for a person who hates bloat, you sure are full of it. ;-) lol Leo * The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help * * 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] Trimming the fat from CSS
Lea de Groot said: On Thu, 15 Apr 2004 16:06:43 +1000, Nick Lo wrote: Does everyone else on the list do this? Mmmm.. not fanatically, but, well, there is a place for everything. The very fact that we are on this list means that our level of fanaticism is somewhat higher than the norm. http://www.eod.com/devil/archive/web_standards.html I have that page printed out as a nice postcard, hanging next to my desk. It's a reminder that I'm not alone, when the cudgel seems particularly heavy :) Slightly related, my blog post from this morning: http://kay.smoljak.com/archives/?web-standards-are-not-easy/ K. -- Kay Smoljak http://kay.smoljak.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] Trimming the fat from CSS
Hugh, I always put in the trailing semicolon and would ask that this practice be adopted by any team I work in even though it is not required. When I wasn't particular about putting it in, I found that when the CSS was later edited by either myself or other maintainers that inevitably a bug in the CSS would be introduced because someone would add several new properties at the end of a rule but overlook terminating the previous property with a semicolon -- irritating. Getting in the habit of always adding the trailing semicolon has pretty much eliminated that ever happening. As Lindsay mentioned earlier, either you or someone else will have to read/edit/debug your code sooner or later and its important that it is readable and easy to follow. Following widely used coding practices just causes less pain and leaves less to trip over for whoever has to work with your code after you've left the building. Cheers, chris On 15/04/2004, at 4:13 PM, Hugh Todd wrote: theGrafixGuy said, You do not need the ; after the last attribute in each style I know this is technically true (browsers will accept it) but I understood that good coding practice is to put the semicolon even after the last attribute. Anyone else know anything about this? -Hugh Todd * 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] Drop down blues ....
Hi all, I've almost done with a small site for a client. Of course, I had to choose xhtml 1.1, just to challenge myself, so that obviously imposes some restrictions. But I have a problem with IE 6 (yes, really ... :-), where the dropdown - done with an unordered list - initially works, then suddently don't etc. It's the menu item named 'Our 3 Months of Work', the url (my slow development server is home) is presales2.cybermedia.dk Any idea why this happens? Btw, the CSS doesn't validate, as I have to put in a .htc to make IE behave altogether ... Thanks in advance Martin * 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] Form submission: CAPTCHA test and accessibility
I was wondering if any of you had opinions/thoughts on the use of CAPTCHA tests (or whatever proper name is given to the little numbered images used to verify a form submitting user is human and not a spamming machine). They are obviously a reaction to the ever increasing amounts of spam being imposed on, e.g. comments systems, however I wondered how much their uptake could end up excluding certain users, e.g. vision impaired. Nick * 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] Re: CAPTCHA test and accessibility
Warning signs go off in my head whenever I encounted CAPTCHA tests on the web, and they scream: developer laziness! The user should only be explicitly involved in the anti-spam process when anti-flooding measures, spam-filters, Bayesian analysis, human editors (god forbid! :) and whatever other user-invisible measures have been proven to fail, and fail badly. I always get mad when I'm faced with a CAPTCHA test on the web, and I'm not at all vision impaired*. Why should I have to prove my humanity to you, you lazy web application? You should be able to figure it out without my help! I am often heard to mumble, crazily. Also! CAPTCHA tests are breakable: http://www.cs.berkeley.edu/~mori/gimpy/gimpy.html And! CAPTCHA tests do indeed break accessibility (among other things): http://www.bestkungfu.com/archive/?id=445 So, count one vote for: they're mostly a bad idea. -- Andrew Taumoefolau * okay, so I'm a little short-sighted in my left eye :). * 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] Preformatted text troubles
I was just wondering: is there was any way to instruct user agents to treat text as preformatted, but to also have that same text break lines to fill line boxes? I think this used to be achieved by using the wrap attribute of the pre tag (with wrap and nowrap as values, I think?), but I'm aiming for xhtml 1.0 conformance and if the pre tag ever officially had the wrap attribute, it doesn't any more :). I'm going to answer my own question here, for posterity's sake (and in case anyone here ever hits the same wall I did): the kind of behaviour I was after here is available in CSS2.1. The white-space text property can take five values (normal, pre, nowrap, pre-wrap, pre-line), and pre-wrap achieves the behaviour I was after. Further reading: http://www.w3.org/TR/2004/CR-CSS21-20040225/text.html#propdef-white-space -- Andrew Taumoefolau * The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help *