Tags:
coding_style1Add my vote for this tag css1Add my vote for this tag dev_essential1Add my vote for this tag create new tag
, view all tags

CSS Coding Standards

TWiki should define CodingStandards parameters - e.g. that the CSS should/should not be compressed, or that there's a compilation step such that developers work with a source that is compiled before being delivered in the skin.

Tools:

-- Contributors: MartinCleaver, -- ArthurClemens

Discussion

-- MartinCleaver - 06 Jun 2006

I am seeing the benefits of small compressed css as well. I am just using http://www.cleancss.com/ (CSS compressor) now to compress pattern skin css. These files will live along the uncompressed files.

For compressed files I use the name pattern sheetname.compressed.css, for instance style.compressed.css. If a stylesheet is updated, the compressed version should be updated as well. A minor hassle, if you see the space gain. Of course, with pattern skin you can simple point the TWIKILAYOUTURL variable to the new compressed version, or to the original version when debugging.

The same goes for compressed javascript, for which I am using Dojo's ShrinkSafe to generate twiki.compressed.js and so on.

So yes, to outline a standard:

  • All css files are kept in their uncompressed format, to support refactoring and debugging, so preferably with comments
  • Compressed css files may be distributed as sheetname.compressed.css, as long as both versions are kept up to date (fully or semi-automatic)

-- ArthurClemens - 06 Jun 2006

Did you measure any performance gain Arthur? (I am asking only out of interest.)

-- KennethLavrsen - 07 Jun 2006

No, I haven't measured. I have only looked at filesizes, and these are about 30% smaller.

-- ArthurClemens - 07 Jun 2006

Changed topic name from TidyCSS to CssCodingStandards.

-- ArthurClemens - 07 Jun 2006

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2006-06-07 - ArthurClemens
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.