Files
.com/css-with-a-hint-of-dry.html
Kenneth Reitz 8f3f30005c content update
2011-01-03 00:33:11 -05:00

194 lines
5.5 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en">
<head>
<title>CSS With a Hint of DRY</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="./theme/css/main.css" type="text/css" />
<link href="./feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Kenneth's log ATOM Feed" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<!--[if lte IE 7]>
<link rel="stylesheet" type="text/css" media="all" href="./css/ie.css"/>
<script src="./js/IE8.js" type="text/javascript"></script><![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" media="all" href="./css/ie6.css"/><![endif]-->
</head>
<body id="index" class="home">
<a href="http://github.com/kennethreitz/">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub" />
</a>
<header id="banner" class="body">
<h1>
<a href=".">Kenneth's log </a>
</h1>
<nav><ul>
<li >
<a href="./category/Life.html">Life</a>
</li>
<li class="active">
<a href="./category/Code.html">Code</a>
</li>
<li >
<a href="./category/projects.html">projects</a>
</li>
</ul></nav>
</header><!-- /#banner -->
<section id="content" class="body">
<article>
<header> <h1 class="entry-title"><a href="css-with-a-hint-of-dry.html"
rel="bookmark" title="Permalink to CSS With a Hint of DRY">CSS With a Hint of DRY</a></h1> </header>
<div class="entry-content">
<footer class="post-info">
<abbr class="published" title="2009-08-20T02:57:00">
Thu 20 August 2009
</abbr>
<p>In <a href="./category/Code.html">Code</a>.
</p>
</footer><!-- /.post-info -->
<p>I am a DRY (<em>Dont Repeat Yourself</em>) programmer. Im not positive,
but I most likely inherited my love for this concept from my
intensive Python immersion. I'm so grateful for it. Anyway, DRY is
an essential stage of any developer's workflow. It drastically
enforces good structure, and significantly increases your logical
skills. As with everything in life, theres a time and place for
DRY. Object oriented programming is one of those places. ## CSS Is
Not DRY Let it be said: CSS is <em>not</em> a programming language. It is
<em>not</em> a programmers language. It is not supposed to be. It is a
styling markup language. But for those of us who like to take a
more structured and programmatic approach, CSS is far from ideal. I
want my CSS to do math. I want it to be dynamic. So, that's where
fun little libraries come in to play that generate CSS on the fly
based on logic and rules! I implore you to take a look at
<a class="reference external" href="http://sandbox.pocoo.org/clevercss">CleverCSS</a>. The awesome
Python CSS generator. It supports variables, code manipulation,
inheritance, and oh, so much more. Ill be writing a Django helper
module soon that generates this CSS on the fly. ###See Also: There
is also <a class="reference external" href="http://sass-lang.com">SASS</a>, or
<a class="reference external" href="http://sass-lang.com">Syntactically Awesome StyleSheets</a>. I must
credit it: it seems to be the originator of the concept, has a
significantly cooler name, and is a bit more widely accepted in the
world. Oh, but thats not written in Python, is it?</p>
</div><!-- /.entry-content -->
<div class="comments">
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_identifier = "css-with-a-hint-of-dry.html";
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://kennethreitz.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
</div>
</article>
</section>
<section id="extras" class="body">
<div class="blogroll">
<h2>Links</h2>
<ul>
<li><a href="http://github.com/kennethreitz">GitHub Repos</a></li>
<li><a href="http://flickr.com/kennethreitz">Photography (Flickr)</a></li>
<li><a href="http://twitter.com/kennethreitz">Latest Tweets</a></li>
<li><a href="http://www.linkedin.com/in/kennethreitz">R&eacute;sum&eacute;</a></li>
<li><a href="http://pick.im/kenneth-reitz">Design Portfolio</a></li>
<li><a href="http://laterstars.com/kennethreitz">Later Stars</a></li>
</ul>
</div><!-- /.blogroll -->
<div class="social">
<ul>
<li><a href="./feeds/all.atom.xml" rel="alternate">atom feed</a></li>
<li><a href="http://facebook.com/kennethreitz">Facebook</a></li>
</ul>
</div><!-- /.social -->
</section><!-- /#extras -->
<footer id="contentinfo" class="body">
<address id="about" class="vcard body">
&copy; 2011 Kenneth Reitz &amp; co. All Rights Reserved.
</address><!-- /#about -->
</footer><!-- /#contentinfo -->
<script type="text/javascript">
var disqus_shortname = 'kennethreitz';
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
<script type="text/javascript" charset="utf-8">
var disqus_developer = 1;
</script>
</body>
</html>