<?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: The Constants Gardener</title>
	<atom:link href="http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/feed/" rel="self" type="application/rss+xml" />
	<link>http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/</link>
	<description>Things that Eric A. Meyer, CSS expert, writes about on his personal Web site; it&#039;s largely Web standards and Web technology, but also various bits of culture, politics, personal observations, and other miscellaneous stuff</description>
	<lastBuildDate>Fri, 19 Mar 2010 00:27:46 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: nate</title>
		<link>http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-385007</link>
		<dc:creator>nate</dc:creator>
		<pubDate>Sun, 15 Jun 2008 22:17:41 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-385007</guid>
		<description>Please check out &lt;a href=&quot;http://wiki.framwurk.org/pmwiki.php/Main/CSSPP&quot; title=&quot;CSSPP&quot; rel=&quot;nofollow&quot;&gt;CSSPP&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Please check out <a href="http://wiki.framwurk.org/pmwiki.php/Main/CSSPP" title="CSSPP" rel="nofollow">CSSPP</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-378612</link>
		<dc:creator>James</dc:creator>
		<pubDate>Sat, 24 May 2008 19:34:39 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-378612</guid>
		<description>Try &lt;a href=&quot;http://klicman.org/p4/&quot; rel=&quot;nofollow&quot;&gt;p4&lt;/a&gt;, the Perl based macro processor. Works great for CSS.</description>
		<content:encoded><![CDATA[<p>Try <a href="http://klicman.org/p4/" rel="nofollow">p4</a>, the Perl based macro processor. Works great for CSS.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CSS Pseudo-Selectors &#8226; Blog Archive &#8226; Joe&#8217;s Apt.</title>
		<link>http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-374749</link>
		<dc:creator>CSS Pseudo-Selectors &#8226; Blog Archive &#8226; Joe&#8217;s Apt.</dc:creator>
		<pubDate>Mon, 12 May 2008 17:59:07 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-374749</guid>
		<description>[...] maintenance sanity, Cascading Style Sheets Server-Side Constants. At the same time, I also share Eric Meyer&#8217;s frustration over the frequent knee-jerk &#8220;use a preprocessor&#8221; responses to proposals such as (and [...]</description>
		<content:encoded><![CDATA[<p>[...] maintenance sanity, Cascading Style Sheets Server-Side Constants. At the same time, I also share Eric Meyer&#8217;s frustration over the frequent knee-jerk &#8220;use a preprocessor&#8221; responses to proposals such as (and [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-225821</link>
		<dc:creator>John</dc:creator>
		<pubDate>Mon, 27 Aug 2007 18:50:25 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-225821</guid>
		<description>Time and time again I wish there were standard CSS constants. Why, oh why hasn&#039;t this happened yet? What is the reasoning behind this refusal, who refuses it, and why do they have they have a career/say-so in something they obviously don&#039;t know anything about? They must have an IT background...

Anyways, regarding post #2: agreed (kidding).</description>
		<content:encoded><![CDATA[<p>Time and time again I wish there were standard CSS constants. Why, oh why hasn&#8217;t this happened yet? What is the reasoning behind this refusal, who refuses it, and why do they have they have a career/say-so in something they obviously don&#8217;t know anything about? They must have an IT background&#8230;</p>
<p>Anyways, regarding post #2: agreed (kidding).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: refalo</title>
		<link>http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-36691</link>
		<dc:creator>refalo</dc:creator>
		<pubDate>Wed, 14 Jun 2006 12:35:46 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-36691</guid>
		<description>The server constants solution is great if I work and test directly with/in my cms - BUT:

Is there a way (in PHP - sorry, I&#039;m not a PHP expert!) to explicitly create/write the output/expanded css file (= css file after the substitution of the constants) on my disk. So I would be able to continue with testing the layout of my website (as I did before with my html-template + my expanded css file) separately in my favorite WYSIWYG-HTML-Editor (z.B. DreamWeaver) + Browser (without PHP!). After the layout testing I would put the files (html/css) separately in my cms backend... (as I did before).

Now (with the PHP server contants in the css file) I am not able to test my html layout any more... !?

Thank&#039;s for help.</description>
		<content:encoded><![CDATA[<p>The server constants solution is great if I work and test directly with/in my cms &#8211; BUT:</p>
<p>Is there a way (in PHP &#8211; sorry, I&#8217;m not a PHP expert!) to explicitly create/write the output/expanded css file (= css file after the substitution of the constants) on my disk. So I would be able to continue with testing the layout of my website (as I did before with my html-template + my expanded css file) separately in my favorite WYSIWYG-HTML-Editor (z.B. DreamWeaver) + Browser (without PHP!). After the layout testing I would put the files (html/css) separately in my cms backend&#8230; (as I did before).</p>
<p>Now (with the PHP server contants in the css file) I am not able to test my html layout any more&#8230; !?</p>
<p>Thank&#8217;s for help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anne 2.0 &#187; CSS Makes Me Cry - Three Reasons</title>
		<link>http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-29046</link>
		<dc:creator>Anne 2.0 &#187; CSS Makes Me Cry - Three Reasons</dc:creator>
		<pubDate>Mon, 15 May 2006 21:15:22 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-29046</guid>
		<description>[...] ors. Sure, I can stick comments all over the place but that&#8217;s no substitute. You can do constants with a CSS preprocessor, but I want it baked into CSS. 2. No si [...]</description>
		<content:encoded><![CDATA[<p>[...] ors. Sure, I can stick comments all over the place but that&#8217;s no substitute. You can do constants with a CSS preprocessor, but I want it baked into CSS. 2. No si [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Viktor</title>
		<link>http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-10125</link>
		<dc:creator>Viktor</dc:creator>
		<pubDate>Tue, 13 Dec 2005 01:31:17 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-10125</guid>
		<description>This is great. Shaun Inman is truly the master of web development.</description>
		<content:encoded><![CDATA[<p>This is great. Shaun Inman is truly the master of web development.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Extra Hot &#187; Defining CSS Constants Using PHP</title>
		<link>http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-10020</link>
		<dc:creator>Extra Hot &#187; Defining CSS Constants Using PHP</dc:creator>
		<pubDate>Fri, 09 Dec 2005 18:08:46 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-10020</guid>
		<description>[...] r interesting technique pointed out in the discussion is the  CSS-SSC work by Shaun Inman. Thoughts by Eric Meyer. read more&#160;&#124;&#160;digg story	 													 	 [...]</description>
		<content:encoded><![CDATA[<p>[...] r interesting technique pointed out in the discussion is the  CSS-SSC work by Shaun Inman. Thoughts by Eric Meyer. read more&nbsp;|&nbsp;digg story	</p>
<p> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charlie Clark</title>
		<link>http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-9703</link>
		<dc:creator>Charlie Clark</dc:creator>
		<pubDate>Thu, 01 Dec 2005 12:14:36 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-9703</guid>
		<description>Inasmuch as CSS already supports constants or reserved names such as font names or colours then it would seem logical to extend this to support user definitions as this improve legibility and maintainability. Without it we are forced to jump through the hoops of server or client side procedural programming for essentially declarative presentation.

I&#039;ve been working in HTML for years but am only just making the switch to CSS (thank you Eric for an excellent book!). I have come across a number of areas where I am going to have to resort to programming where I might hope CSS to help me: rotating images and setting the navigation style for the active page. Faced with the prospect of two different levels of programming (server-side substitution for the image rotation and possibly Javascript for the active navigation) I&#039;ve been asking myself whether it wouldn&#039;t be easier to program everything in one level. For generated pages CSS should be easy to use and integrate otherwise it may be easier to ignore.

I agree CSS should not become XSLT and it should not become a full programming languages but support for dynamic, context-driven values can be included without this.

ie. a:current - highlight a navigation item for the current page without excessive and possibly tricky use of ids and classes;
{background-image URL:random(image1.gif, image2.gif...);}

Furthermore, pushing this into CSS gives both the designer and the user more control of what is seen.</description>
		<content:encoded><![CDATA[<p>Inasmuch as CSS already supports constants or reserved names such as font names or colours then it would seem logical to extend this to support user definitions as this improve legibility and maintainability. Without it we are forced to jump through the hoops of server or client side procedural programming for essentially declarative presentation.</p>
<p>I&#8217;ve been working in HTML for years but am only just making the switch to CSS (thank you Eric for an excellent book!). I have come across a number of areas where I am going to have to resort to programming where I might hope CSS to help me: rotating images and setting the navigation style for the active page. Faced with the prospect of two different levels of programming (server-side substitution for the image rotation and possibly Javascript for the active navigation) I&#8217;ve been asking myself whether it wouldn&#8217;t be easier to program everything in one level. For generated pages CSS should be easy to use and integrate otherwise it may be easier to ignore.</p>
<p>I agree CSS should not become XSLT and it should not become a full programming languages but support for dynamic, context-driven values can be included without this.</p>
<p>ie. a:current &#8211; highlight a navigation item for the current page without excessive and possibly tricky use of ids and classes;<br />
{background-image URL:random(image1.gif, image2.gif&#8230;);}</p>
<p>Furthermore, pushing this into CSS gives both the designer and the user more control of what is seen.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Hanna</title>
		<link>http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-8772</link>
		<dc:creator>Steve Hanna</dc:creator>
		<pubDate>Tue, 22 Nov 2005 01:52:53 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-8772</guid>
		<description>Sorry again, folks. The examples above don&#039;t make much sense because the poster deleted a leading space. Let&#039;s try this:

&lt;code&gt;&#160;#navbar { ... }&lt;/code&gt;

will be OK. [In case this doesn&#039;t come through correctly either, there&#039;s supposed to be a blank space before the &#039;#&#039; in the line above.]</description>
		<content:encoded><![CDATA[<p>Sorry again, folks. The examples above don&#8217;t make much sense because the poster deleted a leading space. Let&#8217;s try this:</p>
<p><code>&nbsp;#navbar { ... }</code></p>
<p>will be OK. [In case this doesn't come through correctly either, there's supposed to be a blank space before the '#' in the line above.]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Hanna</title>
		<link>http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-8771</link>
		<dc:creator>Steve Hanna</dc:creator>
		<pubDate>Tue, 22 Nov 2005 01:48:09 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-8771</guid>
		<description>An amendment to my previous post: To prevent the C preprocessor from barfing on CSS files containing unqualified IDs (things like &quot;#navbar&quot;), you must do two things:

1. Put a space (one or more) before the &#039;#&#039; in the ID&#039;s definition. So,
&lt;code&gt;
#navbar { ... }
&lt;/code&gt;

will cause trouble, but
&lt;code&gt;
 #navbar { ... }
&lt;/code&gt;

will be OK.

2. Change the &#039;cc&#039; command in the shell script to invoke &quot;traditional&quot; C preprocessor behavior (which ignores preprocessor commands that don&#039;t begin in the first column). This will vary from compiler to compiler; on the Gnu C compiler (gcc) the correct command is
&lt;code&gt;
cat $1 &#124; cc -E &lt;strong&gt;-traditional-cpp&lt;/strong&gt; - &#124; grep -v ^# &#124; grep -v ^$
&lt;/code&gt;

Sorry for the inconvenience. As it turns out, I seldom use unqualified IDs, so I just noticed the problem.</description>
		<content:encoded><![CDATA[<p>An amendment to my previous post: To prevent the C preprocessor from barfing on CSS files containing unqualified IDs (things like &#8220;#navbar&#8221;), you must do two things:</p>
<p>1. Put a space (one or more) before the &#8216;#&#8217; in the ID&#8217;s definition. So,<br />
<code><br />
#navbar { ... }<br />
</code></p>
<p>will cause trouble, but<br />
<code><br />
 #navbar { ... }<br />
</code></p>
<p>will be OK.</p>
<p>2. Change the &#8216;cc&#8217; command in the shell script to invoke &#8220;traditional&#8221; C preprocessor behavior (which ignores preprocessor commands that don&#8217;t begin in the first column). This will vary from compiler to compiler; on the Gnu C compiler (gcc) the correct command is<br />
<code><br />
cat $1 | cc -E <strong>-traditional-cpp</strong> - | grep -v ^# | grep -v ^$<br />
</code></p>
<p>Sorry for the inconvenience. As it turns out, I seldom use unqualified IDs, so I just noticed the problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Hanna</title>
		<link>http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-8763</link>
		<dc:creator>Steve Hanna</dc:creator>
		<pubDate>Mon, 21 Nov 2005 19:46:13 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-8763</guid>
		<description>I&#039;ve recently been using the C preprocessor to implement constants in CSS files. For example, to define a color scheme, I insert the following lines in my .CSS file:

#define CLIENT_FG  #123456
#define CLIENT_BG  #987654
#define CLIENT_TXT #012

/* I can then use statements such as: */
body { background-color: CLIENT_BG; color: CLIENT_TXT; }

I have a one-line UNIX shell script named &#039;ppcss&#039; that handles the processing:

cat $1 &#124; cc -E - &#124; grep -v ^# &#124; grep -v ^$

By convention, I name my CSS files *.CSS for the &quot;raw&quot; files (those that contain preprocessor statements) and *.css for the &quot;clean&quot; files (those that contain pure css code, after preprocessing). I edit the .CSS files, then run the command

ppcss foo.CSS &gt; foo.css

to generate the &quot;clean&quot; css file. Note that this script strips comments and blank lines as well as preprocessor statements (which is OK, because I don&#039;t need the comments in the file when I upload it to the web server, and the fact that the comments never have to be downloaded to the user&#039;s browser make me feel better about including lots of comments in my css files).</description>
		<content:encoded><![CDATA[<p>I&#8217;ve recently been using the C preprocessor to implement constants in CSS files. For example, to define a color scheme, I insert the following lines in my .CSS file:</p>
<p>#define CLIENT_FG  #123456<br />
#define CLIENT_BG  #987654<br />
#define CLIENT_TXT #012</p>
<p>/* I can then use statements such as: */<br />
body { background-color: CLIENT_BG; color: CLIENT_TXT; }</p>
<p>I have a one-line UNIX shell script named &#8216;ppcss&#8217; that handles the processing:</p>
<p>cat $1 | cc -E &#8211; | grep -v ^# | grep -v ^$</p>
<p>By convention, I name my CSS files *.CSS for the &#8220;raw&#8221; files (those that contain preprocessor statements) and *.css for the &#8220;clean&#8221; files (those that contain pure css code, after preprocessing). I edit the .CSS files, then run the command</p>
<p>ppcss foo.CSS &gt; foo.css</p>
<p>to generate the &#8220;clean&#8221; css file. Note that this script strips comments and blank lines as well as preprocessor statements (which is OK, because I don&#8217;t need the comments in the file when I upload it to the web server, and the fact that the comments never have to be downloaded to the user&#8217;s browser make me feel better about including lots of comments in my css files).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: torresburriel.com &#187; CSS-SSC: preprocesador de hojas de estilo</title>
		<link>http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-6891</link>
		<dc:creator>torresburriel.com &#187; CSS-SSC: preprocesador de hojas de estilo</dc:creator>
		<pubDate>Wed, 28 Sep 2005 22:24:01 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-6891</guid>
		<description>[...] uilo. Resulta que mirando otra cosa en el weblog del gran Eric Meyer cuando he visto esto: The Constants Gardener. </description>
		<content:encoded><![CDATA[<p>[...] uilo. Resulta que mirando otra cosa en el weblog del gran Eric Meyer cuando he visto esto: The Constants Gardener.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Beacock's Blog</title>
		<link>http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-6415</link>
		<dc:creator>Andrew Beacock's Blog</dc:creator>
		<pubDate>Tue, 13 Sep 2005 20:55:13 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-6415</guid>
		<description>&lt;strong&gt;Constants in CSS - it&#039;s like waiting for a bus&lt;/strong&gt;

I&#039;m more of a server-side programmer really, and don&#039;t deal that much in client-side stuff like CSS and JavaScript, but I try to keep an eye on what is going on in those areas as they tie so closely to the backend stuff.</description>
		<content:encoded><![CDATA[<p><strong>Constants in CSS &#8211; it&#8217;s like waiting for a bus</strong></p>
<p>I&#8217;m more of a server-side programmer really, and don&#8217;t deal that much in client-side stuff like CSS and JavaScript, but I try to keep an eye on what is going on in those areas as they tie so closely to the backend stuff.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Hester</title>
		<link>http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-6344</link>
		<dc:creator>Chris Hester</dc:creator>
		<pubDate>Tue, 06 Sep 2005 08:32:17 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comment-6344</guid>
		<description>This post inspired me to make a demo using CSS generated from PHP:

&lt;a href=&quot;http://www.designdetector.com/2005/09/css-gradients-demo.php&quot; rel=&quot;nofollow&quot;&gt;CSS Gradients Demo&lt;/a&gt;

There&#039;s one other server-side CSS approach people might consider for constants and variables, and that&#039;s &lt;a href=&quot;http://www.w3schools.com/xslfo/default.asp&quot; rel=&quot;nofollow&quot;&gt;XSL-FO&lt;/a&gt;. Or has that been abandoned due to its complexity and verbosity?</description>
		<content:encoded><![CDATA[<p>This post inspired me to make a demo using CSS generated from PHP:</p>
<p><a href="http://www.designdetector.com/2005/09/css-gradients-demo.php" rel="nofollow">CSS Gradients Demo</a></p>
<p>There&#8217;s one other server-side CSS approach people might consider for constants and variables, and that&#8217;s <a href="http://www.w3schools.com/xslfo/default.asp" rel="nofollow">XSL-FO</a>. Or has that been abandoned due to its complexity and verbosity?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head profile="http://gmpg.org/xfn/1">
<title>meyerweb.com</title>
<link rel="openid.server" href="http://www.myopenid.com/server">
<link rel="openid.delegate" href="http://emeyer.myopenid.com/">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link rel="shortcut icon" href="/favicon.ico"><link rel="home" href="http://meyerweb.com/" title="Home" ><link rel="stylesheet" href="http://meyerweb.com/ui/meyerweb.css" type="text/css" media="screen, projection"><link rel="stylesheet" href="http://meyerweb.com/ui/theme.css" type="text/css" media="screen, projection" id="themeLink"><link rel="stylesheet" href="http://meyerweb.com/ui/print.css" type="text/css" media="print"><script src="http://meyerweb.com/ui/addresses.js" type="text/javascript"></script><link rel="stylesheet" href="/ui/wordpress.css" type="text/css" media="screen">
<link rel="stylesheet" href="/ui/tfe.css" type="text/css" media="screen">
<link rel="stylesheet" href="/ui/home.css" type="text/css" media="screen">
<link rel="alternate" type="application/rss+xml" title="Thoughts From Eric" href="/eric/thoughts/rss2/full" />
<link rel="alternate" type="application/rss+xml" title="Thoughts From Eric (only technical posts)" href="/eric/thoughts/category/tech/rss2/full" />
<link rel="alternate" type="application/rss+xml" title="Thoughts From Eric (only personal posts)" href="/eric/thoughts/category/personal/rss2/full" />
<link rel="alternate" type="application/rss+xml" title="Distractions" href="/eric/thoughts/recent-links/rss2" />
<link rel="alternate" type="application/rss+xml" title="Excuse of the Day" href="/feeds/excuse/rss20.xml" />
</head>
<body id="www-meyerweb-com" class="hpg">

<div id="sitemast"><h1><a href="/"><span>meyerweb</span>.com</a></h1></div><div id="search"><h4>Exploration</h4><!-- SiteSearch Google --><form method="get" action="http://www.google.com/custom" target="_top"><div><input type="hidden" name="domains" value="meyerweb.com"></input><label for="sbb" style="display: none">Submit search form</label><input type="submit" name="sa" value="Google Search" id="sbb"></input><label for="sbi" style="display: none">Enter your search terms</label><input type="text" name="q" size="31" maxlength="255" value="" id="sbi"></input><p><input type="radio" name="sitesearch" value="meyerweb.com" checked id="ss1"></input><label for="ss1" title="Search meyerweb.com">meyerweb.com</label><input type="radio" name="sitesearch" value="" id="ss0"></input><label for="ss0" title="Search the Web">Web</label></p><input type="hidden" name="client" value="pub-3772084027748653"></input><input type="hidden" name="forid" value="1"></input><input type="hidden" name="ie" value="ISO-8859-1"></input><input type="hidden" name="oe" value="ISO-8859-1"></input><input type="hidden" name="safe" value="active"></input><input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1"></input><input type="hidden" name="hl" value="en"></input></div></form><!-- SiteSearch Google --><!-- <form method="get" action="http://www.google.com/custom"><div><input type="submit" name="sa" value="Search"><input type="text" name="q" size="20" maxlength="255" value=""><input type="hidden" name="sitesearch" value="meyerweb.com"></div></form><small><a href="http://www.google.com/search">Powered by Google</a></small> --></div><div id="main"><div class="skipper">Skip to: <a href="#extra">site navigation/presentation</a></div><div class="skipper">Skip to: <a href="#thoughts">Thoughts From Eric</a></div>
<div id="thoughts">


<div class="entry">
<h3><a href="http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/" rel="bookmark" title="Permanent Link: The Constants Gardener">The Constants Gardener</a></h3>
<ul class="meta">
<li class="date">Wed 31 Aug 2005</li>
<li class="time">1747</li>
<li class="cat"><a href="http://meyerweb.com/eric/thoughts/category/tech/css/" title="View all posts in CSS" rel="category tag">CSS</a><br> <a href="http://meyerweb.com/eric/thoughts/category/tech/standards/" title="View all posts in Standards" rel="category tag">Standards</a></li>
<li class="cmt"><a href="http://meyerweb.com/eric/thoughts/2005/08/31/the-constants-gardener/#comments">34 responses</a></li>
<li></li><li></li></ul>

<div class="text">
<p>
This news is a little musty, but <a href="http://www.shauninman.com/">Shaun Inman</a> <a href="http://www.shauninman.com/plete/2005/08/css-ssc-quickie">updated CSS-SSC recently</a>.  If you&#8217;re using CSS-SSC, you should definitely go grab the update.
</p>
<p>
&#8220;Hey, what&#8217;s <acronym title="Cascading Style Sheets Server-Side Constants">CSS-SSC</acronym>?&#8221; you exclaim?  Oh, I&#8217;m sorry.  It stands for Cascading Style Sheets Server-Side Constants.  Here&#8217;s Shaun&#8217;s initial example:
</p>
<pre>
@server constants {
    linkColor: #AB6666;
    linkColorHover: #710101;
    }
a { color: linkColor; }
a:hover { color: linkColorHover; }
</pre>
<p>
In other words, you can define your own constants in CSS.  This works because CSS-SSC is a <i>preprocessor</i>&#8212;it processes the style sheet before it&#8217;s sent to the browser, and turns it into something the browser can handle.  (Put another way, what arrives at the browser is a regular style sheet, with none of the &#8216;SSC&#8217; information.)  Shaun offers more details in <a href="http://www.shauninman.com/plete/2005/08/css-constants">an earlier post</a>.  CSS-SSC requires you to have PHP hanging about, and also to edit some stuff on your server, like <tt>.htaccess</tt> files.  You&#8217;ll also have to be careful about how you name your constants: use the constant name <tt>color</tt>, for example, and your CSS is going to go to a particularly mangled form of textual hell.
</p>
<p>
Personally, I&#8217;m both enthused and annoyed by CSS-SSC.  I think it&#8217;s a great solution: definitely one of the best, lightest-weight, easiest approaches to adding preprocessing to CSS.  I&#8217;m seriously considering putting it to use on <a href="http://alistapart.com/">ALA</a>, in which I jumped through a few grouping hoops in order to get the fonts and colors just the way Jason wanted them.  Dropping back to constants would make life a bit easier&#8212;and would also simplify the whole &#8220;per-issue coloration&#8221; feature.  (Which I already have working, but via a large number of hoops, several of them on fire.)
</p>
<p>
I&#8217;m annoyed because it bothers me that Shaun had to create CSS-SSC in the first place.  There have been occasional requests for constants in CSS.  They get shot down every time.  &#8220;Use a preprocessor!&#8221; is the cry, and at first glance, CSS-SSC would seem to give credence to that response.  From my point of view, however, CSS should have had constants long ago, and what Shaun has done is proof.
</p>
<p>
The refusal to add constants as a feature of CSS has always stuck me as highly pointless.  Over the past decade, many people have expressed a need for CSS constants in a number of fora, and it&#8217;s a good bet many more have had the need without publicly expressing it.  Adding it to CSS would have done little to increase complexity on the implementor&#8217;s side; Shaun&#8217;s one-page PHP script (a good deal less when you remove the comments) proves that.  Adding it to CSS would have meant authors could just <em>do</em> it, without having to install anything else first.  Shaun&#8217;s made installation about as easy as it gets, but it&#8217;s still three or four steps more than should exist&#8212;and, for some authors, three or four impossible steps, due to their hosting situation.  And if you aren&#8217;t running a local web server, then you can&#8217;t test your CSS-SSC-enhanced styles locally; they&#8217;ll have to go to a web server first.
</p>
<p>
Because CSS still lacks, and will apparently continue to lack, a way to define your own constants, I&#8217;m really glad Shaun has devised this low-threshold solution.  I just wish that it hadn&#8217;t been necessary for him to do so in the first place.
</p>

</div>

</div>

</div>
<p style="font-size: 90%; text-align: right; margin-top: 0.5em; padding-top: 0;">(If you care, there's even an <a href="/eric/thoughts/page/2/">archive of previous thoughts</a>...)</p>

</div><div id="extra"><div class="panel" id="archipelago"><h4>Identity Archipelago</h4><ul><li><a href="http://flickr.com/photos/meyerweb/" rel="me">Flickr</a></li><li><a href="http://twitter.com/meyerweb/" rel="me">Twitter</a></li><li><a href="http://dopplr.com/traveller/meyerweb">Dopplr</a></li><li><a href="http://www.linkedin.com/in/meyerweb" rel="me">LinkedIn</a></li><li><a href="http://technorati.com/profile/emeyer" rel="me">Technorati</a></li></ul></div><div class="panel" id="pointers"><h4>Projects Elsewhere</h4><ul><li><a href="http://aneventapart.com/">An Event Apart</a></li><li><a href="http://complexspiral.com/">Complex Spiral Consulting</a></li><li><a href="http://www.webassist.com/go/css/emeyer/">CSS Sculptor</a></li><li><a href="http://css-discuss.org/">css-discuss</a></li><li><a href="http://microformats.org/">Microformats</a></li><li><a href="http://s5project.org/">S5</a></li></ul></div><div class="panel" id="tour"><ul><li><a href="http://fray.com/issue3/"><img src="http://fray.com/images/i3c.gif" alt="Fray Contributor (Issue 3: Sex &amp; Death)" /></a></li><!-- <li><a href="http://www.webassist.com/go/css/emeyer/"><img src="/pix/CS_ad_180x109.jpg" alt="CSS Sculptor for Dreamweaver" style="max-width: 100%;" /></a></li> --></ul></div><div class="panel">
<h4>Recently Tweeted</h4>
<p class="more"><a href="http://twitter.com/meyerweb">see more</a></p>
<p>Coffee shop hacking—using a stir-stick to spread cream cheese on my bagel. <small>&#8211;tweeted 26 minutes ago</small></p>
</div><div id="sideblog" class="panel">
<h4>Distractions</h4>
<p class="more">
<a href="/eric/thoughts/recent-links/">archive</a>
</p>
<ul>
<li><a href="http://tweetagewasteland.com/2010/03/my-head-is-in-the-cloud/" title="March 18 | &#8220;I sense that my addiction to the realtime stream is only making room for the consumption of a faster stream.&#8221;">My Head is in the Cloud</a> <small>[via <a href="http://daringfireball.net/">John</a>]</small></li>
<li><a href="http://8bitnyc.com/" title="March 17 | All of a sudden I want to establish a mission in Central Park and negotiate with the natives for gold and food.">8-Bit NYC</a></li>
<li><a href="http://www.youtube.com/watch?v=nFicqklGuB0&amp;feature=player_embedded" title="March 12 | Wry comment expressing my appreciation of the creative derivativeness of this video and its uncanny accuracy in mocking common tropes.">Academy Award Winning Movie Trailer</a></li>
<li><a href="http://www.youtube.com/watch?v=414TmP12WAU" title="March 9 | &#8220;Apple juice&#8230; for half price!&#8221;  More like twice PRICELESS.  (Note: If you&#8217;re at work, don your headphones.)">Happy in Paraguay</a> <small>[via <a href="http://unstoppablerobotninja.com/">Ethan</a>]</small></li>
<li><a href="http://www.youtube.com/watch?v=9V5ubAOeOBk&amp;feature=player_embedded" title="February 10 | This is approximately the best thing ever.">U900 -Walk Don&#8217;t Run (Isogabamaware)</a></li>
<li><a href="http://www.456bereastreet.com/archive/201002/sifr_default_css_hides_content_from_at_least_one_screen_reader/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A 456bereastreet %28456 Berea Street%29" title="February 8 | -9999px comes through again, but I really wish we were beyond that kind of thing.">sIFR default CSS hides content from at least one screen reader</a></li>
<li><a href="http://www.macosxhints.com/article.php?story=20100117064356428" title="February 8 | Storing this for future use.">Take a picture with the iSight camera when a folder is opened</a></li>
<li><a href="http://mingle2.com/blog/view/web-developer-mind" title="February 4 | Mostly valid.  (SEE WHAT I DID THERE?)">The Mind of a Web Developer: An Illustrated Diagram</a></li>
<li><a href="http://www.theonion.com/content/news/science_channel_refuses_to_dumb" title="January 28 | &#8220;Punkin Chunkin, for Christ&#8217;s sake&#8230; What more do you people want?&#8221;">Science Channel Refuses To Dumb Down Science Any Further</a></li>
<li><a href="http://www.mailchimp.com/blog/project-omnivore-declassified/" title="January 27 | Sounds like quite a feat.  But I wonder how we&#8217;d feel if Microsoft or Google announced the same kind of thing on their e-mail services.">MailChimp&#8217;s Project Omnivore: Declassified</a></li>
<li><a href="http://www.politifact.com/truth-o-meter/statements/2010/jan/25/carolyn-maloney/congresswoman-says-democratic-presidents-create-mo/" title="January 26 | &#8220;Obviously, luck matters a lot, but when there is a consistent pattern over more than 60 years, it starts to look like more than just luck.&#8221;">Congresswoman says Democratic presidents create more private-sector jobs</a></li>
<li><a href="http://www.ted.com/talks/taylor_mali_what_teachers_make.html" title="January 25 | Truth.">Taylor Mali: What teachers make</a></li>
<li><a href="http://notebook.johnmartz.com/how-websites-work?c=1" title="January 22 | At last, the truth is out and I can stop pretending:  beatific monkeys are what makes it all go.">How websites work</a></li>
</ul>
</div>
<div class="panel" id="advisory">
<div class="guarded">
<a href="http://blogadvisorysystem.com/"><img src="/pix/bas/guarded.png" alt="Blog Advisory System Alert Level: Guarded"></a>
</div>
</div>

<div class="panel" id="excuse">
<h4>The <a href="/feeds/excuse/">excuse of the day</a> is</h4>
<p>neutrino interactions</p>
</div>

<div class="panel" id="extras">
<h4>Extras</h4>
<ul>
<li><a href="/feeds/">Feeds</a> &#8226;</li>
<li><a href="/eric/faq.html">FAQ</a> &#8226;</li>
<li><a href="/family.html">Family</a></li>
</ul>
</div>

</div>

<div id="navigate">
<h4>Navigation</h4>
<ul id="navlinks">
<li id="archLink"><a href="/eric/thoughts/">Archives</a></li>
<li id="cssLink"><a href="/eric/css/">CSS</a></li>
<li id="toolsLink"><a href="/eric/tools/">Toolbox</a></li>
<li id="writeLink"><a href="/eric/writing.html">Writing</a></li>
<li id="speakLink"><a href="/eric/talks/">Speaking</a></li>
<li id="otherLink"><a href="/other/">Leftovers</a></li>
<li id="aboutsite"><a href="/ui/about.html">About this site</a></li>
</ul>
</div>

<div id="footer">
<p class="sosumi">All contents of this site, unless otherwise noted, are &copy;1995-2008 <strong>Eric A. and Kathryn S. Meyer</strong>.  All Rights Reserved.</p>
<p>"<a href="/eric/thoughts/">Thoughts From Eric</a>" is powered by the &uuml;bercool <a href="http://wordpress.org/">WordPress</a></p>
</div>
</body>
</html>
