<?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: Summary of the two current CSS Constants proposals</title>
	<atom:link href="http://www.css3.info/summary-of-the-two-current-css-constants-proposals/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.css3.info/summary-of-the-two-current-css-constants-proposals/</link>
	<description>All you ever needed to know about CSS3</description>
	<lastBuildDate>Tue, 07 Feb 2012 18:52:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Ben Daley</title>
		<link>http://www.css3.info/summary-of-the-two-current-css-constants-proposals/comment-page-1/#comment-262852</link>
		<dc:creator>Ben Daley</dc:creator>
		<pubDate>Fri, 18 Nov 2011 12:12:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.css3.info/?p=313#comment-262852</guid>
		<description>I think this is a great proposal, my preference being with fantasai’s approach (for flexiblity).

The abstraction is more likely to increase readability and comprehension.

Given that many styles (box-shadow, gradient backgrounds etc.) require multiple rules to render them reliably across browsers, we get faced with either repeating the same multiple rules for each selector that uses them (bloated &amp; hard to maintain), adding additional mark-up (not a best practise and not always possible), or grouping all applicable selectors (less readable &amp; loses context from other rules).

For those among us who don&#039;t want the complexity (simplicity?) of learning to use constants/variables, then don&#039;t use them. If it all gets a bit too much perhaps consider flipping burgers. I hear mctrolls are hiring.

I think it would be great to be able to write css like so.

@define style-sets { shadow: {...}, gradient: {..} }

nav { `shadow; `gradient; }
aside { `shadow }

Presumably &quot;values&quot; can be used in style-sets too?</description>
		<content:encoded><![CDATA[<p>I think this is a great proposal, my preference being with fantasai’s approach (for flexiblity).</p>
<p>The abstraction is more likely to increase readability and comprehension.</p>
<p>Given that many styles (box-shadow, gradient backgrounds etc.) require multiple rules to render them reliably across browsers, we get faced with either repeating the same multiple rules for each selector that uses them (bloated &amp; hard to maintain), adding additional mark-up (not a best practise and not always possible), or grouping all applicable selectors (less readable &amp; loses context from other rules).</p>
<p>For those among us who don&#8217;t want the complexity (simplicity?) of learning to use constants/variables, then don&#8217;t use them. If it all gets a bit too much perhaps consider flipping burgers. I hear mctrolls are hiring.</p>
<p>I think it would be great to be able to write css like so.</p>
<p>@define style-sets { shadow: {&#8230;}, gradient: {..} }</p>
<p>nav { `shadow; `gradient; }<br />
aside { `shadow }</p>
<p>Presumably &#8220;values&#8221; can be used in style-sets too?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JP</title>
		<link>http://www.css3.info/summary-of-the-two-current-css-constants-proposals/comment-page-1/#comment-261881</link>
		<dc:creator>JP</dc:creator>
		<pubDate>Wed, 08 Jun 2011 14:42:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.css3.info/?p=313#comment-261881</guid>
		<description>@Andrey Petrov: I think you have a good idea about scoping. Perhaps something along the following lines:

@local {
    $color1: #ccc;
    $color2: #999;
}

@global {
    $color1: green;
    $color3: red;
}

Constants defined in @local would only have scope within the current file. Constants defined in @global would have scope in all stylesheets included in a web page.</description>
		<content:encoded><![CDATA[<p>@Andrey Petrov: I think you have a good idea about scoping. Perhaps something along the following lines:</p>
<p>@local {<br />
    $color1: #ccc;<br />
    $color2: #999;<br />
}</p>
<p>@global {<br />
    $color1: green;<br />
    $color3: red;<br />
}</p>
<p>Constants defined in @local would only have scope within the current file. Constants defined in @global would have scope in all stylesheets included in a web page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JP</title>
		<link>http://www.css3.info/summary-of-the-two-current-css-constants-proposals/comment-page-1/#comment-261862</link>
		<dc:creator>JP</dc:creator>
		<pubDate>Sat, 04 Jun 2011 13:19:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.css3.info/?p=313#comment-261862</guid>
		<description> I personally prefer the second option. It feels more like c macros to me. The only thing I would change is instead of var(blah), I would prefer $blah. I think this is easier to read and probably easier to parse.</description>
		<content:encoded><![CDATA[<p> I personally prefer the second option. It feels more like c macros to me. The only thing I would change is instead of var(blah), I would prefer $blah. I think this is easier to read and probably easier to parse.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fin</title>
		<link>http://www.css3.info/summary-of-the-two-current-css-constants-proposals/comment-page-1/#comment-260779</link>
		<dc:creator>fin</dc:creator>
		<pubDate>Fri, 21 Jan 2011 08:17:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.css3.info/?p=313#comment-260779</guid>
		<description>We should not stop the progress. CSS constants atleast are necessity for better style management. Yes, its possible to name a class as red and give it its own red colorish rgb style and then add multiple classes to element which would work similarly to constants. It would though lead back to adding styles to html page and not really to css file. Only difference would be that the style attributes have been moved to under class attribute. It would clutter the html. 

Having some constants would make nobodys work harder but make it easier for many.</description>
		<content:encoded><![CDATA[<p>We should not stop the progress. CSS constants atleast are necessity for better style management. Yes, its possible to name a class as red and give it its own red colorish rgb style and then add multiple classes to element which would work similarly to constants. It would though lead back to adding styles to html page and not really to css file. Only difference would be that the style attributes have been moved to under class attribute. It would clutter the html. </p>
<p>Having some constants would make nobodys work harder but make it easier for many.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rolfen</title>
		<link>http://www.css3.info/summary-of-the-two-current-css-constants-proposals/comment-page-1/#comment-260522</link>
		<dc:creator>rolfen</dc:creator>
		<pubDate>Sun, 28 Nov 2010 17:34:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.css3.info/?p=313#comment-260522</guid>
		<description> I have a header div and a left div. The header div is absolute-positioned in relation to the top of the page. I want the left div (and the main div) to drop the height of the top div. Therefore I&#039;d like to use a CSS variable, so that the header div height can be changed without needing going through my CSS every time and doing multiple replaces. Anyone wants to tell me that I ad doing things the wrong way? </description>
		<content:encoded><![CDATA[<p> I have a header div and a left div. The header div is absolute-positioned in relation to the top of the page. I want the left div (and the main div) to drop the height of the top div. Therefore I&#8217;d like to use a CSS variable, so that the header div height can be changed without needing going through my CSS every time and doing multiple replaces. Anyone wants to tell me that I ad doing things the wrong way?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: max jooher</title>
		<link>http://www.css3.info/summary-of-the-two-current-css-constants-proposals/comment-page-1/#comment-259870</link>
		<dc:creator>max jooher</dc:creator>
		<pubDate>Fri, 13 Aug 2010 06:24:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.css3.info/?p=313#comment-259870</guid>
		<description>I don&#039;t think CSS needs variables (mutable???) or even constants - especially in such cumbersome form as in these proposals. 
 
All that CSS really needs is just a rule concatenation mechanism (inside stylesheet). It would give a way more possibilities without introducing any new entities. 
 
Say, one could simply define a regular rule:  
 
.myTextColor{color:#000} 
.roundCorners{border-radius:4px;} 
 
and refer to it from other rules:  
 
.myPage {background:pink}.myColor.roundCorners 
 
And those rules would combine exactly the same way as if these styles were specified in html as: </description>
		<content:encoded><![CDATA[<p>I don&#8217;t think CSS needs variables (mutable???) or even constants &#8211; especially in such cumbersome form as in these proposals.</p>
<p>All that CSS really needs is just a rule concatenation mechanism (inside stylesheet). It would give a way more possibilities without introducing any new entities.</p>
<p>Say, one could simply define a regular rule: </p>
<p>.myTextColor{color:#000}</p>
<p>.roundCorners{border-radius:4px;}</p>
<p>and refer to it from other rules: </p>
<p>.myPage {background:pink}.myColor.roundCorners</p>
<p>And those rules would combine exactly the same way as if these styles were specified in html as:</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: apaella</title>
		<link>http://www.css3.info/summary-of-the-two-current-css-constants-proposals/comment-page-1/#comment-257133</link>
		<dc:creator>apaella</dc:creator>
		<pubDate>Thu, 05 Nov 2009 08:36:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.css3.info/?p=313#comment-257133</guid>
		<description>But why add this?
Who needs image sprites with http://en.wikipedia.org/wiki/Data_URI_scheme supported?</description>
		<content:encoded><![CDATA[<p>But why add this?<br />
Who needs image sprites with <a href="http://en.wikipedia.org/wiki/Data_URI_scheme" rel="nofollow">http://en.wikipedia.org/wiki/Data_URI_scheme</a> supported?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony R.</title>
		<link>http://www.css3.info/summary-of-the-two-current-css-constants-proposals/comment-page-1/#comment-248362</link>
		<dc:creator>Tony R.</dc:creator>
		<pubDate>Thu, 02 Jul 2009 15:15:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.css3.info/?p=313#comment-248362</guid>
		<description>I know it&#039;s been said before, but I can&#039;t help but continue to wonder

Why doesn&#039;t CSS just adopt XPath for selectors?  

- Easy to learn
- Most CSS selectors have direct equivalents in XPath, making learning and conversion easy
- XPath includes many powerful features for advanced users

It wouldn&#039;t exactly solve the constants debate, but it would make selectors powerful enough that the CSS authors who want to turn it into a programming language might at least feel that they have enough power with XPath that they might be willing to live without constants.</description>
		<content:encoded><![CDATA[<p>I know it&#8217;s been said before, but I can&#8217;t help but continue to wonder</p>
<p>Why doesn&#8217;t CSS just adopt XPath for selectors?  </p>
<p>- Easy to learn<br />
- Most CSS selectors have direct equivalents in XPath, making learning and conversion easy<br />
- XPath includes many powerful features for advanced users</p>
<p>It wouldn&#8217;t exactly solve the constants debate, but it would make selectors powerful enough that the CSS authors who want to turn it into a programming language might at least feel that they have enough power with XPath that they might be willing to live without constants.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amol Kelkar</title>
		<link>http://www.css3.info/summary-of-the-two-current-css-constants-proposals/comment-page-1/#comment-233715</link>
		<dc:creator>Amol Kelkar</dc:creator>
		<pubDate>Fri, 20 Mar 2009 18:54:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.css3.info/?p=313#comment-233715</guid>
		<description>I worked at a major web services company where I defined and implemented very simple variables support in CSS (CSSX - patent pending). The task at hand was to implement a themeing system that could apply the same theme across a bunch of different sites and yet has very small learning curve for CSS authors. The solution was instantly liked and adopted by everyone who saw it and we found out many other advantages other than the intended themeing use. Of course we had to preprocess it into CSS before sending to browsers, but it would be great if something similar is available in browsers through the CSS 3 standard. Here is our syntax -

#define {TextColor1: #444; TextColor2: #777; TextColorBold: #111}
.MyBox {color: ?TextColor1}
.MyBox .ImportantStuff {color: ?TextColorBold}
.AnotherBox {inherit: MyBox; color: ?TextColor2}

This is equivalent to the following CSS -
.MyBox {color: #444}
.MyBox .ImportantStuff {color: #111}
.AnotherBox {color:#444; color: #777}
.AnotherBox .ImportantStuff {color: #111}

You will notice that the variables are simple macro-like substitutes and the &quot;inherit: ClassName&quot; syntax will bring in all attributes of the class along with any other rules that include that class. Small side effect - &quot;#define&quot; is taken so can&#039;t use &quot;define&quot; as an html id.

More complex syntax could add more power, but this simple syntax was more than enough to meet the requirements we had. 

Why do this in browser?
- Using the inherit syntax keeps CSS files smaller, processing on the server side &#039;unfolds&#039; the inherits and we have larger files to send to the browser.
- Also if only some variables need to be changed (e.g. switching a theme) we could send a new CSS file down with a simple #define block with new variable values, rather than sending whole CSS down preprocessed with the new values.</description>
		<content:encoded><![CDATA[<p>I worked at a major web services company where I defined and implemented very simple variables support in CSS (CSSX &#8211; patent pending). The task at hand was to implement a themeing system that could apply the same theme across a bunch of different sites and yet has very small learning curve for CSS authors. The solution was instantly liked and adopted by everyone who saw it and we found out many other advantages other than the intended themeing use. Of course we had to preprocess it into CSS before sending to browsers, but it would be great if something similar is available in browsers through the CSS 3 standard. Here is our syntax -</p>
<p>#define {TextColor1: #444; TextColor2: #777; TextColorBold: #111}<br />
.MyBox {color: ?TextColor1}<br />
.MyBox .ImportantStuff {color: ?TextColorBold}<br />
.AnotherBox {inherit: MyBox; color: ?TextColor2}</p>
<p>This is equivalent to the following CSS -<br />
.MyBox {color: #444}<br />
.MyBox .ImportantStuff {color: #111}<br />
.AnotherBox {color:#444; color: #777}<br />
.AnotherBox .ImportantStuff {color: #111}</p>
<p>You will notice that the variables are simple macro-like substitutes and the &#8220;inherit: ClassName&#8221; syntax will bring in all attributes of the class along with any other rules that include that class. Small side effect &#8211; &#8220;#define&#8221; is taken so can&#8217;t use &#8220;define&#8221; as an html id.</p>
<p>More complex syntax could add more power, but this simple syntax was more than enough to meet the requirements we had. </p>
<p>Why do this in browser?<br />
- Using the inherit syntax keeps CSS files smaller, processing on the server side &#8216;unfolds&#8217; the inherits and we have larger files to send to the browser.<br />
- Also if only some variables need to be changed (e.g. switching a theme) we could send a new CSS file down with a simple #define block with new variable values, rather than sending whole CSS down preprocessed with the new values.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: berlin</title>
		<link>http://www.css3.info/summary-of-the-two-current-css-constants-proposals/comment-page-1/#comment-230540</link>
		<dc:creator>berlin</dc:creator>
		<pubDate>Fri, 27 Feb 2009 12:30:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.css3.info/?p=313#comment-230540</guid>
		<description>Gut!</description>
		<content:encoded><![CDATA[<p>Gut!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!--
This site's performance optimized by W3 Total Cache:

W3 Total Cache improves the user experience of your blog by caching
frequent operations, reducing the weight of various files and providing
transparent content delivery network integration.

Learn more about our WordPress Plugins: http://www.w3-edge.com/wordpress-plugins/


Served from: css3.info @ 2012-02-08 22:44:23 -->
