<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Code Pencil &#187; css</title>
	<atom:link href="http://www.codepencil.com/index.php/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codepencil.com</link>
	<description>Manu Mahajan`s blog</description>
	<lastBuildDate>Tue, 14 Apr 2009 16:15:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Thoughts On Developing A CSS Strategy</title>
		<link>http://www.codepencil.com/index.php/thoughts-on-developing-a-css-strategy/</link>
		<comments>http://www.codepencil.com/index.php/thoughts-on-developing-a-css-strategy/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 18:30:10 +0000</pubDate>
		<dc:creator>Manu Mahajan</dc:creator>
				<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.codepencil.com/index.php/thoughts-on-developing-a-css-strategy/</guid>
		<description><![CDATA[While planning for an upcoming project at my workplace I&#8217;ve had to think about developing a CSS strategy for a web application. I&#8217;ve never spent so much time thinking about the presentation layer since we are generally more concerned with the business logic and the back-end but this time we need to create a site [...]]]></description>
			<content:encoded><![CDATA[<p>While planning for an upcoming project at my workplace I&#8217;ve had to think about developing a CSS strategy for a web application. I&#8217;ve never spent so much time thinking about the presentation layer since we are generally more concerned with the business logic and the back-end but this time we need to create a site that is very different from previous projects that we&#8217;ve done. </p>
<p>So the idea is to create a web site that uses the so called <strong>best practices</strong>:</p>
<ul>
<li>Semantic HTML</li>
<li>Separation of content and markup</li>
<li>Cross browser support</li>
<li>Search engine friendliness</li>
</ul>
<p>And everything else that a modern web site should have.</p>
<p><span id="more-13"></span></p>
<h2>Why a CSS strategy?</h2>
<p>The problem is simple &#8211; A big web site with multiple developers working on it simultaneously along with their individual coding styles. </p>
<p>There needs to be a set of guidelines for everyone to follow. At a bare minimum you need consistency in coding and (a sense of) ease of maintainence. Anything above that (like good readability) is a bonus.</p>
<p>For me I don&#8217;t know what is more readable &#8211; hundreds of lines of CSS code or a couple of dozen tables nested inside each other. I&#8217;ve seen both and I&#8217;ve pulled my hair out trying to debug seemingly trivial issues.</p>
<p>CSS is not like any other programming language where you have standard design patterns or best practices to refer to. Quite often there are a zillion ways to do the same thing. You could chose between using external stylesheets or inline styles; If you use external stylesheets you need to organize them effectively; You could define selectors for ids or classes or for html elements; You could use nested styles based on multiple things; You need hacks to support older browsers and so on&#8230;</p>
<h2>What will be the components of my CSS strategy?</h2>
<p>There are multiple challenges involved in a project like this. The ones that I can think of at the moment are</p>
<ol>
<li><strong>CSS framework</strong> &#8211; Is there need to use an external CSS framework or should one build everything from scratch.</li>
<li><strong>Organisation of CSS code</strong> &#8211; It is a matter of time that your CSS code will grow and if you&#8217;re building a big site with complex styling you will need a strategy to organize your CSS files.</li>
<li><strong>Guidelines for coders</strong> &#8211; There needs to be a set of rules for consistency and for efficiency (code reuse, tackling common problems etc.)</li>
<li><strong>Workflow definition</strong> &#8211; Can a coder modify a file that is used globally and where a simple change might impact the whole site? At what level should new styles be added?</li>
<li><strong>CSS hacks</strong> &#8211; Sooner or later you face a situation where you need to apply browser specific hacks. This is definitely a last resort but you need have a plan to tackle such issues.</li>
</ol>
<p>I do not know the answers to these questions yet but I have some vague ideas forming in my head based on some resources on the web and my instincts. Let&#8217;s see how they develop over the next few days.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codepencil.com/index.php/thoughts-on-developing-a-css-strategy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
