<?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: CSS constants</title>
	<atom:link href="http://www.wait-till-i.com/2005/02/11/css-constants/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wait-till-i.com/2005/02/11/css-constants/</link>
	<description>For a better web with more professional jobs - can talk, will travel</description>
	<lastBuildDate>Wed, 08 Sep 2010 14:36:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Marcin Krawiec</title>
		<link>http://www.wait-till-i.com/2005/02/11/css-constants/comment-page-1/#comment-109</link>
		<dc:creator>Marcin Krawiec</dc:creator>
		<pubDate>Fri, 11 Mar 2005 10:31:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.wait-till-i.com/?p=24#comment-109</guid>
		<description>&quot;I am aware that this is butchering the idea of CSS as presentation only[..]&quot;

That&#039;s why this is not a good idea IMHO. I think a better idea would be generating (by a script) static .css only once (of course once after every modifiaction ;) ) - in the development time. The presentation layer in the final product wouldn&#039;t be confused by some logic stuff... 

Creating some logic layer in the presentation layer might lead to some bad practices (not only the less experienced designers/developers) and i think this is the main disadvantage of this idea.</description>
		<content:encoded><![CDATA[<p>&#8220;I am aware that this is butchering the idea of <span class="caps">CSS</span> as presentation only[..]&#8221;</p>
<p>That&#8217;s why this is not a good idea <span class="caps">IMHO</span>. I think a better idea would be generating (by a script) static .css only once (of course once after every modifiaction ;) ) &#8211; in the development time. The presentation layer in the final product wouldn&#8217;t be confused by some logic stuff&#8230;</p>
<p>Creating some logic layer in the presentation layer might lead to some bad practices (not only the less experienced designers/developers) and i think this is the main disadvantage of this idea.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: linoj</title>
		<link>http://www.wait-till-i.com/2005/02/11/css-constants/comment-page-1/#comment-93</link>
		<dc:creator>linoj</dc:creator>
		<pubDate>Mon, 21 Feb 2005 19:22:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.wait-till-i.com/?p=24#comment-93</guid>
		<description>hi, i need to extend this to pull the constants in from an external file, e.g. constants.css, so they can be shared by multiple stylesheets. Can you show me code that will do this? TIA</description>
		<content:encoded><![CDATA[<p>hi, i need to extend this to pull the constants in from an external file, e.g. constants.css, so they can be shared by multiple stylesheets. Can you show me code that will do this? <span class="caps">TIA</span></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Novitski</title>
		<link>http://www.wait-till-i.com/2005/02/11/css-constants/comment-page-1/#comment-66</link>
		<dc:creator>Paul Novitski</dc:creator>
		<pubDate>Thu, 17 Feb 2005 18:56:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.wait-till-i.com/?p=24#comment-66</guid>
		<description>Good work, Chris.  I love the elegance of &lt;code&gt;@import &#039;cssconst.php?c=demo.css&#039;;&lt;/code&gt;!

As long as the processed file is validatable I don&#039;t really see a problem.  We all routinely submit pages generated on the fly by server-side scripts to validators to check the processed results, never the raw, unprocessed script.

If for some reason you really wanted to make the unprocessed CSS validatable, how?

One way would be to use comments to contain the preprocessor trigger, e.g.:
&lt;code&gt;color: #000; /* &lt;navbordercolor&gt; */&lt;/navbordercolor&gt;&lt;/code&gt;
or
&lt;code&gt;#000 #333; /* &lt; #000=colorA&gt; &lt; #CCC=colorB&gt; */&lt;/&gt;&lt;/&gt;&lt;/code&gt;
That would require more parsing logic but nothing extreme; you&#039;d just need to parse the line and perform global replacements on that line only.  It&#039;s conceptually similar to your technique, just requires a much longer replacement trigger than &quot;$color1&quot;!

Alternatively, you could use valid but improbable placeholder values, such as:
&lt;code&gt;6;&lt;/code&gt;
&lt;code&gt;color: rgb(-0.123,128,0.456);&lt;/code&gt;
&lt;code&gt;width: 123.456;&lt;/code&gt;
...in which peculiar values, negatives, and decimals that you *know* will never be used realistically in context can be safely replaced with variable strings globally throughout the file.  This one makes me nervous for its lack of unique variable indicators (like PHP&#039;s $) but could work.

Paul</description>
		<content:encoded><![CDATA[<p>Good work, Chris.  I love the elegance of <code>@import 'cssconst.php?c=demo.css';</code>!</p>
<p>As long as the processed file is validatable I don&#8217;t really see a problem.  We all routinely submit pages generated on the fly by server-side scripts to validators to check the processed results, never the raw, unprocessed script.</p>
<p>If for some reason you really wanted to make the unprocessed <span class="caps">CSS</span> validatable, how?</p>
<p>One way would be to use comments to contain the preprocessor trigger, e.g.:<br />
<code>color: #000; /* &lt;navbordercolor&gt; */&lt;/navbordercolor&gt;</code><br />
or<br />
<code>#000 #333; /* &lt; #000=colorA&gt; &lt; #CCC=colorB&gt; */&lt;/&gt;&lt;/&gt;</code><br />
That would require more parsing logic but nothing extreme; you&#8217;d just need to parse the line and perform global replacements on that line only.  It&#8217;s conceptually similar to your technique, just requires a much longer replacement trigger than &#8220;$color1&#8221;!</p>
<p>Alternatively, you could use valid but improbable placeholder values, such as:<br />
<code>6;</code><br />
<code>color: rgb(-0.123,128,0.456);</code><br />
<code>width: 123.456;</code><br />
...in which peculiar values, negatives, and decimals that you <strong>know</strong> will never be used realistically in context can be safely replaced with variable strings globally throughout the file.  This one makes me nervous for its lack of unique variable indicators (like <span class="caps">PHP</span>&#8217;s $) but could work.</p>
<p>Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://www.wait-till-i.com/2005/02/11/css-constants/comment-page-1/#comment-65</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Thu, 17 Feb 2005 18:04:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.wait-till-i.com/?p=24#comment-65</guid>
		<description>And even:

.
.
$ua = get_browser();
$IE = ( $ua-&gt;browser == &quot;IE&quot; );
$NS = ( $ua-&gt;browser == &quot;Netscape&quot; );
.
.
?&gt;
&lt;code&gt;
html, body {
  &#124;
  &#124;
  font-size: &lt; \?=($IE ? &quot;x-small&quot; : &quot;small&quot;)\?&gt;;
  &#124;
  &#124;
}&lt;/&gt;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>And even:</p>
<p>.<br />
.</p>
<p>$ua = get_browser();<br />
$IE = ( $ua->browser  "IE" );<br />
$NS = ( $ua-&gt;browser  &#8220;Netscape&#8221; );<br />
.</p>
<p>.<br />
?><br />
<code><br />
html, body {<br />
|</code></p>
<p>|<br />
font-size: &lt; ?=($IE ? "x-small" : "small")?&gt;;<br />
|</p>
<p>|<br />
}&lt;/&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: linoj</title>
		<link>http://www.wait-till-i.com/2005/02/11/css-constants/comment-page-1/#comment-47</link>
		<dc:creator>linoj</dc:creator>
		<pubDate>Fri, 11 Feb 2005 21:59:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.wait-till-i.com/?p=24#comment-47</guid>
		<description>cool! now I want more :)
- expressions: margin-right: ($outerwidth - $innerwidth)/2;
- functions: color: lighten( $color, 0.25 );
- support for @import in the css
ok, nevermind</description>
		<content:encoded><![CDATA[<p>cool! now I want more :) &#8211; expressions: margin-right: ($outerwidth &#8211; $innerwidth)/2; &#8211; functions: color: lighten( $color, 0.25 ); &#8211; support for @import in the css<br />
ok, nevermind</p>
]]></content:encoded>
	</item>
</channel>
</rss>
