<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: How to structure large CSS files</title> <atom:link href="http://friendlybit.com/css/how-to-structure-large-css-files/feed/" rel="self" type="application/rss+xml" /><link>http://friendlybit.com/css/how-to-structure-large-css-files/</link> <description>You have found Friendly Bit, a web development blog. I focus on client side technologies like CSS, HTML and Javascript. You find my articles below and categories to the right.</description> <lastBuildDate>Thu, 11 Mar 2010 16:54:48 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.2</generator> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>By: kit</title><link>http://friendlybit.com/css/how-to-structure-large-css-files/#comment-32916</link> <dc:creator>kit</dc:creator> <pubDate>Thu, 20 Aug 2009 00:34:29 +0000</pubDate> <guid
isPermaLink="false">http://friendlybit.com/css/how-to-structure-large-css-files/#comment-32916</guid> <description>This article is great and I utilized most of these techniques for a while until I started to adapt things a bit and I didnt see this technique mentioned in other comments so I thought I&#039;d add my 1cent...I now group related properties on the same line, especially position-left-top; width-height; I then sort everything alphabetically. I find this makes the scanning simpler when navigating styles.#example{
position:value; top:value; left:value;
width:value; height:value;
}I do think the catagory ordering could be useful, especially for font styling and I&#039;ll have to see how that works out in my next project.Also using 2 spaces for tabbing is nice too when I start getting into more complex designs</description> <content:encoded><![CDATA[<p>This article is great and I utilized most of these techniques for a while until I started to adapt things a bit and I didnt see this technique mentioned in other comments so I thought I&#8217;d add my 1cent&#8230;</p><p>I now group related properties on the same line, especially position-left-top; width-height; I then sort everything alphabetically. I find this makes the scanning simpler when navigating styles.</p><p>#example{<br
/> position:value; top:value; left:value;<br
/> width:value; height:value;<br
/> }</p><p>I do think the catagory ordering could be useful, especially for font styling and I&#8217;ll have to see how that works out in my next project.</p><p>Also using 2 spaces for tabbing is nice too when I start getting into more complex designs</p> ]]></content:encoded> </item> <item><title>By: Damjan Mozetic</title><link>http://friendlybit.com/css/how-to-structure-large-css-files/#comment-31633</link> <dc:creator>Damjan Mozetic</dc:creator> <pubDate>Wed, 11 Mar 2009 10:12:58 +0000</pubDate> <guid
isPermaLink="false">http://friendlybit.com/css/how-to-structure-large-css-files/#comment-31633</guid> <description>Can&#039;t agree on the Always use the “full path” to elements rule. If you do that you will probably encounter a case later on, which will require you to override the previous rule with a new, more specific one and you won&#039;t be able to do that unless you use the !important CSS rule.I&#039;d rather opt for as short selectors as possible and comment my code sections appropriately to quickly find which selector represents what.</description> <content:encoded><![CDATA[<p>Can&#8217;t agree on the Always use the “full path” to elements rule. If you do that you will probably encounter a case later on, which will require you to override the previous rule with a new, more specific one and you won&#8217;t be able to do that unless you use the !important CSS rule.</p><p>I&#8217;d rather opt for as short selectors as possible and comment my code sections appropriately to quickly find which selector represents what.</p> ]]></content:encoded> </item> <item><title>By: Large CSS file management &#124; MadeByPi® Blog</title><link>http://friendlybit.com/css/how-to-structure-large-css-files/#comment-31167</link> <dc:creator>Large CSS file management &#124; MadeByPi® Blog</dc:creator> <pubDate>Wed, 12 Nov 2008 12:48:25 +0000</pubDate> <guid
isPermaLink="false">http://friendlybit.com/css/how-to-structure-large-css-files/#comment-31167</guid> <description>[...] interesting thoughts on structuring CSS [...]</description> <content:encoded><![CDATA[<p>[...] interesting thoughts on structuring CSS [...]</p> ]]></content:encoded> </item> <item><title>By: Emil Stenström</title><link>http://friendlybit.com/css/how-to-structure-large-css-files/#comment-31085</link> <dc:creator>Emil Stenström</dc:creator> <pubDate>Fri, 03 Oct 2008 22:21:13 +0000</pubDate> <guid
isPermaLink="false">http://friendlybit.com/css/how-to-structure-large-css-files/#comment-31085</guid> <description>@craig: Cool documentation, I have a lot to learn from that one! Thanks a lot for sharing it, I&#039;m sure lots of people will find it useful.</description> <content:encoded><![CDATA[<p>@craig: Cool documentation, I have a lot to learn from that one! Thanks a lot for sharing it, I&#8217;m sure lots of people will find it useful.</p> ]]></content:encoded> </item> <item><title>By: craig</title><link>http://friendlybit.com/css/how-to-structure-large-css-files/#comment-31083</link> <dc:creator>craig</dc:creator> <pubDate>Thu, 02 Oct 2008 21:57:24 +0000</pubDate> <guid
isPermaLink="false">http://friendlybit.com/css/how-to-structure-large-css-files/#comment-31083</guid> <description>I am just starting to document &amp; structure my html and here is the documention i have done so far. Just thought I&#039;d share.&lt;a href=&quot;http://austin.servershost.net/~cbutcher/dev/Documentation of CSS file.doc&quot; rel=&quot;nofollow&quot;&gt;Documentation of CSS file.doc&lt;/a&gt;</description> <content:encoded><![CDATA[<p>I am just starting to document &amp; structure my html and here is the documention i have done so far. Just thought I&#8217;d share.</p><p><a
href="http://austin.servershost.net/~cbutcher/dev/Documentation of CSS file.doc" rel="nofollow">Documentation of CSS file.doc</a></p> ]]></content:encoded> </item> <item><title>By: suraj</title><link>http://friendlybit.com/css/how-to-structure-large-css-files/#comment-30869</link> <dc:creator>suraj</dc:creator> <pubDate>Tue, 05 Aug 2008 20:31:47 +0000</pubDate> <guid
isPermaLink="false">http://friendlybit.com/css/how-to-structure-large-css-files/#comment-30869</guid> <description>hi check out my blog,this is the way i manage my css file...&amp; i have been succesfully used this over more than 50 projectshttp://surajnaikin.blogspot.com/2008/07/how-to-manage-your-style-sheet.html</description> <content:encoded><![CDATA[<p>hi check out my blog,</p><p>this is the way i manage my css file&#8230;&amp; i have been succesfully used this over more than 50 projects</p><p><a
href="http://surajnaikin.blogspot.com/2008/07/how-to-manage-your-style-sheet.html" rel="nofollow">http://surajnaikin.blogspot.com/2008/07/how-to-manage-your-style-sheet.html</a></p> ]]></content:encoded> </item> <item><title>By: James O'Kelly</title><link>http://friendlybit.com/css/how-to-structure-large-css-files/#comment-30587</link> <dc:creator>James O'Kelly</dc:creator> <pubDate>Sat, 17 May 2008 06:06:15 +0000</pubDate> <guid
isPermaLink="false">http://friendlybit.com/css/how-to-structure-large-css-files/#comment-30587</guid> <description>Of course if you are lucky enough to use Ruby on Rails to build websites you can generate the whole mess using Sass :)</description> <content:encoded><![CDATA[<p>Of course if you are lucky enough to use Ruby on Rails to build websites you can generate the whole mess using Sass :)</p> ]]></content:encoded> </item> <item><title>By: 12 Articles and Tools for CSS structuring and optimising &#124; Onyx Design Weblog</title><link>http://friendlybit.com/css/how-to-structure-large-css-files/#comment-30538</link> <dc:creator>12 Articles and Tools for CSS structuring and optimising &#124; Onyx Design Weblog</dc:creator> <pubDate>Wed, 09 Apr 2008 08:02:12 +0000</pubDate> <guid
isPermaLink="false">http://friendlybit.com/css/how-to-structure-large-css-files/#comment-30538</guid> <description>[...] How to structure large css files An extensive article whith a lot of tips and tricks to structure large CSS files. [...]</description> <content:encoded><![CDATA[<p>[...] How to structure large css files An extensive article whith a lot of tips and tricks to structure large CSS files. [...]</p> ]]></content:encoded> </item> <item><title>By: lewis litanzios</title><link>http://friendlybit.com/css/how-to-structure-large-css-files/#comment-30465</link> <dc:creator>lewis litanzios</dc:creator> <pubDate>Wed, 19 Mar 2008 17:29:03 +0000</pubDate> <guid
isPermaLink="false">http://friendlybit.com/css/how-to-structure-large-css-files/#comment-30465</guid> <description>&#039;I’ve actually never used a CSS Formater, but then again, I’m very_ picky about what CSS i write, and it’s almost always already optimized when I first write it.&#039; - haha, i wish i could say i coded so neatly. workin&#039; on it as always. check it out and let me know if you find any of it useful.&#039;I always start with box layout, and then complete the same rules with typography information afterwards.&#039; - so let me get this straight. you will have your universal h1, h2, h3... p typographical elements defined and then you&#039;ll target h3&#039;s and p&#039;s (and whatever) in their native divs to give them extra styling, where appropriate?up until now i&#039;ve really done my best to stick with my universal styles, but now i&#039;m finding myself needing more than six-odd fonts per page, so am beginning to embrace semantic conventions e.g. a date font might be styled as .date{...}i&#039;m toying with the idea of posting a blog entry in the hope of getting some email advice;&#039;to use semantic id&#039;s sitewide (and have to name stuff all over the place), or use reusable classes&#039; - what&#039;s your take?cheers emil. big aid.</description> <content:encoded><![CDATA[<p>&#8216;I’ve actually never used a CSS Formater, but then again, I’m very_ picky about what CSS i write, and it’s almost always already optimized when I first write it.&#8217; &#8211; haha, i wish i could say i coded so neatly. workin&#8217; on it as always. check it out and let me know if you find any of it useful.</p><p>&#8216;I always start with box layout, and then complete the same rules with typography information afterwards.&#8217; &#8211; so let me get this straight. you will have your universal h1, h2, h3&#8230; p typographical elements defined and then you&#8217;ll target h3&#8217;s and p&#8217;s (and whatever) in their native divs to give them extra styling, where appropriate?</p><p>up until now i&#8217;ve really done my best to stick with my universal styles, but now i&#8217;m finding myself needing more than six-odd fonts per page, so am beginning to embrace semantic conventions e.g. a date font might be styled as .date{&#8230;}</p><p>i&#8217;m toying with the idea of posting a blog entry in the hope of getting some email advice;</p><p>&#8216;to use semantic id&#8217;s sitewide (and have to name stuff all over the place), or use reusable classes&#8217; &#8211; what&#8217;s your take?</p><p>cheers emil. big aid.</p> ]]></content:encoded> </item> <item><title>By: Emil Stenström</title><link>http://friendlybit.com/css/how-to-structure-large-css-files/#comment-30409</link> <dc:creator>Emil Stenström</dc:creator> <pubDate>Thu, 06 Mar 2008 19:23:58 +0000</pubDate> <guid
isPermaLink="false">http://friendlybit.com/css/how-to-structure-large-css-files/#comment-30409</guid> <description>@Johaness: Yeah, if you look at a full site with lots of different subpages it gets more difficult, and I&#039;ve often resorted to something like you describe. One CSS for global sites, and one for each subsection. I use server-side code to decide what to include when.@lewis litanzios: Great comment, thanks! I can see how people want to work with different sections at different times, but that&#039;s not how I work. I always start with box layout, and then complete the same rules with typography information afterwards. Works well for me.I&#039;ve actually never used a CSS Formater, but then again, I&#039;m _very_ picky about what CSS i write, and it&#039;s almost always already optimized when I first write it.</description> <content:encoded><![CDATA[<p>@Johaness: Yeah, if you look at a full site with lots of different subpages it gets more difficult, and I&#8217;ve often resorted to something like you describe. One CSS for global sites, and one for each subsection. I use server-side code to decide what to include when.</p><p>@lewis litanzios: Great comment, thanks! I can see how people want to work with different sections at different times, but that&#8217;s not how I work. I always start with box layout, and then complete the same rules with typography information afterwards. Works well for me.</p><p>I&#8217;ve actually never used a CSS Formater, but then again, I&#8217;m _very_ picky about what CSS i write, and it&#8217;s almost always already optimized when I first write it.</p> ]]></content:encoded> </item> <item><title>By: lewis litanzios</title><link>http://friendlybit.com/css/how-to-structure-large-css-files/#comment-30408</link> <dc:creator>lewis litanzios</dc:creator> <pubDate>Thu, 06 Mar 2008 18:16:50 +0000</pubDate> <guid
isPermaLink="false">http://friendlybit.com/css/how-to-structure-large-css-files/#comment-30408</guid> <description>i&#039;ve loosely based my latest project on andy budd&#039;s (http://tinyurl.com/2oucvd) approach; splitting  default, basic, links &amp; navigation, layout, typography, colour, forms, and tables up into separate sections. obviously an alternative would be to source independent, dedicated, css files - this approach has never enticed me into using it. it&#039;s just too fragmented imo, not to mention load time.one downside to splitting this info up into dedicated sections is you often find your self writing the selectors two or three times in different sections when you could, in theory, just include all properties under one selector in one place.breaking things up has far more benefits though. for instance you can sit down and concentrate specifically on the typography for instance (although in my next project i&#039;ll be deciding upon my type before i do any layout). it&#039;s far to easy to become a whore to type once the layout is all done and dusted.think i agree on the full path issue; i&#039;ll be implementing that in my next project. look at it this way, if you do use full paths it ties in with the alphabetical approach nicely.not sure about the indentation thing, but nevertheless interesting. i&#039;m one of those people that uses &#039;the least human readable approach&#039;, in one liners, for my css presentation. my justification is it&#039;s less scrolling down to get to what you want; once there you can obvious format it how you like when/if editing it.i&#039;m a big fan of CSS Formatter and Optimiser (http://tinyurl.com/2vpxfe) and use it at the end of every project to tidy things up, group selectors, shorten property values (hex colours, shorthand padding/margins etc) and generally get a nudge in the write direction for how i could make things a bit tighter in the next project.my 3 cents :)cheers emil!</description> <content:encoded><![CDATA[<p>i&#8217;ve loosely based my latest project on andy budd&#8217;s (<a
href="http://tinyurl.com/2oucvd">http://tinyurl.com/2oucvd</a>) approach; splitting  default, basic, links &amp; navigation, layout, typography, colour, forms, and tables up into separate sections. obviously an alternative would be to source independent, dedicated, css files &#8211; this approach has never enticed me into using it. it&#8217;s just too fragmented imo, not to mention load time.</p><p>one downside to splitting this info up into dedicated sections is you often find your self writing the selectors two or three times in different sections when you could, in theory, just include all properties under one selector in one place.</p><p>breaking things up has far more benefits though. for instance you can sit down and concentrate specifically on the typography for instance (although in my next project i&#8217;ll be deciding upon my type before i do any layout). it&#8217;s far to easy to become a whore to type once the layout is all done and dusted.</p><p>think i agree on the full path issue; i&#8217;ll be implementing that in my next project. look at it this way, if you do use full paths it ties in with the alphabetical approach nicely.</p><p>not sure about the indentation thing, but nevertheless interesting. i&#8217;m one of those people that uses &#8216;the least human readable approach&#8217;, in one liners, for my css presentation. my justification is it&#8217;s less scrolling down to get to what you want; once there you can obvious format it how you like when/if editing it.</p><p>i&#8217;m a big fan of CSS Formatter and Optimiser (<a
href="http://tinyurl.com/2vpxfe">http://tinyurl.com/2vpxfe</a>) and use it at the end of every project to tidy things up, group selectors, shorten property values (hex colours, shorthand padding/margins etc) and generally get a nudge in the write direction for how i could make things a bit tighter in the next project.</p><p>my 3 cents :)</p><p>cheers emil!</p> ]]></content:encoded> </item> <item><title>By: Documenting CSS - Friendly Bit</title><link>http://friendlybit.com/css/how-to-structure-large-css-files/#comment-30358</link> <dc:creator>Documenting CSS - Friendly Bit</dc:creator> <pubDate>Wed, 27 Feb 2008 22:55:09 +0000</pubDate> <guid
isPermaLink="false">http://friendlybit.com/css/how-to-structure-large-css-files/#comment-30358</guid> <description>[...] to figure out someone else&#8217;s code. To give you some ideas of your own, I wrote about how I structure my CSS previously. You don&#8217;t have to use that one, just be conscious about your choice, and document [...]</description> <content:encoded><![CDATA[<p>[...] to figure out someone else&#8217;s code. To give you some ideas of your own, I wrote about how I structure my CSS previously. You don&#8217;t have to use that one, just be conscious about your choice, and document [...]</p> ]]></content:encoded> </item> <item><title>By: Dan&#8217;s Test Blog &#187; Blog Archive &#187; How to structure large CSS files</title><link>http://friendlybit.com/css/how-to-structure-large-css-files/#comment-30250</link> <dc:creator>Dan&#8217;s Test Blog &#187; Blog Archive &#187; How to structure large CSS files</dc:creator> <pubDate>Wed, 06 Feb 2008 05:14:30 +0000</pubDate> <guid
isPermaLink="false">http://friendlybit.com/css/how-to-structure-large-css-files/#comment-30250</guid> <description>[...] Order your selectors like the HTML [...]</description> <content:encoded><![CDATA[<p>[...] Order your selectors like the HTML [...]</p> ]]></content:encoded> </item> <item><title>By: Johaness</title><link>http://friendlybit.com/css/how-to-structure-large-css-files/#comment-30184</link> <dc:creator>Johaness</dc:creator> <pubDate>Thu, 24 Jan 2008 17:20:22 +0000</pubDate> <guid
isPermaLink="false">http://friendlybit.com/css/how-to-structure-large-css-files/#comment-30184</guid> <description>Another solution would be to break up the large CSS files into multiple CSS files. The top-level CSS file would have rules common to all pages. The other CSS files will either over-ride the rules of the main CSS file or define new ones.The problem is if you use server side includes (e.g. PHP) and have the page header (with the opening *and* closing HEAD tags ), you will include the exact same CSS files for every page.E.g. I include this on top of every page:&lt;pre&gt;&lt;code lang=&quot;html&quot;&gt;
CSS/* all css files included here */&lt;!-- menu --&gt;
&lt;a href=&quot;#&quot; rel=&quot;nofollow&quot;&gt; Home &lt;/a&gt;
&lt;a href=&quot;#&quot; rel=&quot;nofollow&quot;&gt; Other Page&lt;/a&gt;
&lt;/code&gt;&lt;/pre&gt;That problem can be solved with a very messy and misguided solution - conditional if statements that test for the name of each page and include accordingly.The better way would be to use an MVC framework or plain Object Oriented PHP for a far more elegant solution.</description> <content:encoded><![CDATA[<p>Another solution would be to break up the large CSS files into multiple CSS files. The top-level CSS file would have rules common to all pages. The other CSS files will either over-ride the rules of the main CSS file or define new ones.</p><p>The problem is if you use server side includes (e.g. PHP) and have the page header (with the opening *and* closing HEAD tags ), you will include the exact same CSS files for every page.</p><p>E.g. I include this on top of every page:</p><pre><code lang="html">
 CSS 

/* all css files included here */

&lt;!-- menu -->
 &lt;a href="#" rel="nofollow"> Home &lt;/a>
 &lt;a href="#" rel="nofollow"> Other Page&lt;/a>
</code></pre><p>That problem can be solved with a very messy and misguided solution &#8211; conditional if statements that test for the name of each page and include accordingly.</p><p>The better way would be to use an MVC framework or plain Object Oriented PHP for a far more elegant solution.</p> ]]></content:encoded> </item> <item><title>By: Strutturare i CSS - ReFactor.it</title><link>http://friendlybit.com/css/how-to-structure-large-css-files/#comment-29663</link> <dc:creator>Strutturare i CSS - ReFactor.it</dc:creator> <pubDate>Tue, 27 Nov 2007 20:34:13 +0000</pubDate> <guid
isPermaLink="false">http://friendlybit.com/css/how-to-structure-large-css-files/#comment-29663</guid> <description>[...] (visto che il foglio di stile è tutto fuorché ordinato) segnalo l’articolo di Friendly Bit “How to structure large CSS files” che dà qualche consiglio su come dare struttura ai [...]</description> <content:encoded><![CDATA[<p>[...] (visto che il foglio di stile è tutto fuorché ordinato) segnalo l’articolo di Friendly Bit “How to structure large CSS files” che dà qualche consiglio su come dare struttura ai [...]</p> ]]></content:encoded> </item> </channel> </rss>
<!-- This site's performance optimized by W3 Total Cache. Dramatically improve the speed and reliability of your blog!

Learn more about our WordPress Plugins: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching 13/36 queries in 0.123 seconds using disk

Served from: c8.67.364a.static.theplanet.com @ 2010-03-12 21:16:20 -->