<?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: Random CSS Thought: Math in CSS</title>
	<atom:link href="http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/feed/" rel="self" type="application/rss+xml" />
	<link>http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/</link>
	<description></description>
	<lastBuildDate>Sat, 04 Sep 2010 07:50:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Anonymous</title>
		<link>http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/comment-page-1/#comment-58947</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Tue, 03 Aug 2010 19:03:51 +0000</pubDate>
		<guid isPermaLink="false">http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/#comment-58947</guid>
		<description>@Thomas Barrasso:

You know that CSS3 had not even been proposed when this was posted right?
Also Firefox&#039;s &quot;calc()&quot; [-moz-calc() right now] doesn&#039;t work for widths yet ...which is the main thing people want this for.
Also IE9 is in &quot;Developer Platform Preview&quot; and is such a slimmed down version that it is almost completely unusable for anything other than looking at it and saying &quot;OK, I can see that it supports this ...&quot;

So hopefully CSS3&#039;s calc() will get completed in Firefox soon.
then we can all be happy ☺</description>
		<content:encoded><![CDATA[<p>@Thomas Barrasso:</p>
<p>You know that CSS3 had not even been proposed when this was posted right?<br />
Also Firefox&#8217;s &#8220;calc()&#8221; [-moz-calc() right now] doesn&#8217;t work for widths yet &#8230;which is the main thing people want this for.<br />
Also IE9 is in &#8220;Developer Platform Preview&#8221; and is such a slimmed down version that it is almost completely unusable for anything other than looking at it and saying &#8220;OK, I can see that it supports this &#8230;&#8221;</p>
<p>So hopefully CSS3&#8242;s calc() will get completed in Firefox soon.<br />
then we can all be happy ☺</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Barrasso</title>
		<link>http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/comment-page-1/#comment-57977</link>
		<dc:creator>Thomas Barrasso</dc:creator>
		<pubDate>Sat, 17 Jul 2010 20:32:11 +0000</pubDate>
		<guid isPermaLink="false">http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/#comment-57977</guid>
		<description>http://hacks.mozilla.org/2010/06/css3-calc/, there is always the CSS3 calc() method, that works in firefox 4 via -moz-calc and IE9 via calc, but from what I here neither are perfect solutions.</description>
		<content:encoded><![CDATA[<p><a href="http://hacks.mozilla.org/2010/06/css3-calc/" rel="nofollow">http://hacks.mozilla.org/2010/06/css3-calc/</a>, there is always the CSS3 calc() method, that works in firefox 4 via -moz-calc and IE9 via calc, but from what I here neither are perfect solutions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Morrisey</title>
		<link>http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/comment-page-1/#comment-54212</link>
		<dc:creator>Tom Morrisey</dc:creator>
		<pubDate>Wed, 19 May 2010 20:04:01 +0000</pubDate>
		<guid isPermaLink="false">http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/#comment-54212</guid>
		<description>Any updates on the status of this?  I just happened to try this while goofing around and it appears to actually work exactly as I would expect in every recent browser.  Still doesn&#039;t validate with W3C though.  Anyone have any insight?</description>
		<content:encoded><![CDATA[<p>Any updates on the status of this?  I just happened to try this while goofing around and it appears to actually work exactly as I would expect in every recent browser.  Still doesn&#8217;t validate with W3C though.  Anyone have any insight?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Max</title>
		<link>http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/comment-page-1/#comment-52534</link>
		<dc:creator>Max</dc:creator>
		<pubDate>Wed, 28 Apr 2010 08:37:46 +0000</pubDate>
		<guid isPermaLink="false">http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/#comment-52534</guid>
		<description>The idea of implementing mathematical functions in CSS is something that would make life as a web developer easier. But still, I would imagine that you&#039;d still have to use javascript to actually make the equations. The only way out today would be to skip hard-coded css files and work with the css properties in javascript instead. If you use libraries, such as jquery, the selectors still would be pretty much the same and more properties would be available to control through the &quot;javascript-css&quot; such as animations and effects on events, such as clicks,toggles, focus.</description>
		<content:encoded><![CDATA[<p>The idea of implementing mathematical functions in CSS is something that would make life as a web developer easier. But still, I would imagine that you&#8217;d still have to use javascript to actually make the equations. The only way out today would be to skip hard-coded css files and work with the css properties in javascript instead. If you use libraries, such as jquery, the selectors still would be pretty much the same and more properties would be available to control through the &#8220;javascript-css&#8221; such as animations and effects on events, such as clicks,toggles, focus.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Spiller</title>
		<link>http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/comment-page-1/#comment-45346</link>
		<dc:creator>Spiller</dc:creator>
		<pubDate>Sun, 31 Jan 2010 23:32:07 +0000</pubDate>
		<guid isPermaLink="false">http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/#comment-45346</guid>
		<description>Since I have worked more with programming than web-design, there were two things I wished for in CSS: math and constants.
To continue your example with % and borders, lets image we can set the border with like this:
define{ border_width: 5px; }

and then we could define the element like this:
width:50% - border_width * 2;
border:border_width solid #000;
float:left;

If we wanted to change the border thickness we could just change border_width and both values are updated.
Since I have a hard time with choosing good colors I will probably need to change it again later on... So setting these as constants would speed up testing since I otherwise would need to change it several places in the style sheet...
I also like keeping things like the spacing between elements somewhat constant throughout the design, setting this as a constant would be nice.


The reason I would like math and constants in CSS is also to make it easier to understand.
If we used the previous example, but having a fixed width of 150px instead of 50% we would normally say:
width:140px; /* 150px - 10px */

but wouldn&#039;t this be much easier to understand:
define{
total_width = 150px;
border = 5px;
}
width: total_width - border *2;
I have caught myself thinking &quot;Why did I write that number?&quot; when editing in a part of the style sheet I hadn&#039;t touched for a while. If it had been defined as above, such cases would be less likely.
Of course, it adds a little bit of extra weight to the code, but if you are worried about that you could always make a small program to replace the constants and do the math where possible.


I started learning HTML and CSS a half year ago when my school forced me to do it, but it turned out to be more interesting than I thought. So I&#039;m still quite new to this though...</description>
		<content:encoded><![CDATA[<p>Since I have worked more with programming than web-design, there were two things I wished for in CSS: math and constants.<br />
To continue your example with % and borders, lets image we can set the border with like this:<br />
define{ border_width: 5px; }</p>
<p>and then we could define the element like this:<br />
width:50% &#8211; border_width * 2;<br />
border:border_width solid #000;<br />
float:left;</p>
<p>If we wanted to change the border thickness we could just change border_width and both values are updated.<br />
Since I have a hard time with choosing good colors I will probably need to change it again later on&#8230; So setting these as constants would speed up testing since I otherwise would need to change it several places in the style sheet&#8230;<br />
I also like keeping things like the spacing between elements somewhat constant throughout the design, setting this as a constant would be nice.</p>
<p>The reason I would like math and constants in CSS is also to make it easier to understand.<br />
If we used the previous example, but having a fixed width of 150px instead of 50% we would normally say:<br />
width:140px; /* 150px &#8211; 10px */</p>
<p>but wouldn&#8217;t this be much easier to understand:<br />
define{<br />
total_width = 150px;<br />
border = 5px;<br />
}<br />
width: total_width &#8211; border *2;<br />
I have caught myself thinking &#8220;Why did I write that number?&#8221; when editing in a part of the style sheet I hadn&#8217;t touched for a while. If it had been defined as above, such cases would be less likely.<br />
Of course, it adds a little bit of extra weight to the code, but if you are worried about that you could always make a small program to replace the constants and do the math where possible.</p>
<p>I started learning HTML and CSS a half year ago when my school forced me to do it, but it turned out to be more interesting than I thought. So I&#8217;m still quite new to this though&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/comment-page-1/#comment-44930</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Wed, 27 Jan 2010 23:05:20 +0000</pubDate>
		<guid isPermaLink="false">http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/#comment-44930</guid>
		<description>references in CSS would be better...

#header {
	height:150px;
 	background:#fff url(&quot;pretty-header.png&quot;) no-repeat 0 0;
}
#content {
	height:100% - #header.height;
	background:#fff url(&quot;content-bg.png&quot;) repeat-y top center;
}</description>
		<content:encoded><![CDATA[<p>references in CSS would be better&#8230;</p>
<p>#header {<br />
	height:150px;<br />
 	background:#fff url(&#8220;pretty-header.png&#8221;) no-repeat 0 0;<br />
}<br />
#content {<br />
	height:100% &#8211; #header.height;<br />
	background:#fff url(&#8220;content-bg.png&#8221;) repeat-y top center;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SiNT4X</title>
		<link>http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/comment-page-1/#comment-40749</link>
		<dc:creator>SiNT4X</dc:creator>
		<pubDate>Tue, 08 Dec 2009 01:59:25 +0000</pubDate>
		<guid isPermaLink="false">http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/#comment-40749</guid>
		<description>YES - I was searching the web for this, and found this page.

Math in CSS would be next-gen amazing. I&#039;m a die-hard tables fan forced to be a DIV user both by my &quot;it&#039;s time&quot; feelings as well as client-requests. Let&#039;s just say the transformation has been less than pleasing, and some math in CSS would be amazing.</description>
		<content:encoded><![CDATA[<p>YES &#8211; I was searching the web for this, and found this page.</p>
<p>Math in CSS would be next-gen amazing. I&#8217;m a die-hard tables fan forced to be a DIV user both by my &#8220;it&#8217;s time&#8221; feelings as well as client-requests. Let&#8217;s just say the transformation has been less than pleasing, and some math in CSS would be amazing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: All Marked Up &#160;&#9733;&#160; CSS3 and beyond</title>
		<link>http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/comment-page-1/#comment-38770</link>
		<dc:creator>All Marked Up &#160;&#9733;&#160; CSS3 and beyond</dc:creator>
		<pubDate>Sun, 15 Nov 2009 18:19:46 +0000</pubDate>
		<guid isPermaLink="false">http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/#comment-38770</guid>
		<description>[...] go weak at the knees. Why is something this offensive even being considered when a one or two minor additions to the positioning model we already have would allow us to intuitively create layouts without [...]</description>
		<content:encoded><![CDATA[<p>[...] go weak at the knees. Why is something this offensive even being considered when a one or two minor additions to the positioning model we already have would allow us to intuitively create layouts without [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CSS Wishlist: New Ideas, Debates and Solutions &#124; WEBDESIGN FAN</title>
		<link>http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/comment-page-1/#comment-33607</link>
		<dc:creator>CSS Wishlist: New Ideas, Debates and Solutions &#124; WEBDESIGN FAN</dc:creator>
		<pubDate>Fri, 02 Oct 2009 04:44:17 +0000</pubDate>
		<guid isPermaLink="false">http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/#comment-33607</guid>
		<description>[...] but simple math could solve many problems in CSS. An article over on KilianValkof.com titled &quot;Random CSS Thought: Math in CSS&quot; presents just this idea and specific examples of how this could be [...]</description>
		<content:encoded><![CDATA[<p>[...] but simple math could solve many problems in CSS. An article over on KilianValkof.com titled &quot;Random CSS Thought: Math in CSS&quot; presents just this idea and specific examples of how this could be [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CSS Wishlist: New Ideas, Debates and Solutions &#183; Variedades e Bookmarks</title>
		<link>http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/comment-page-1/#comment-31761</link>
		<dc:creator>CSS Wishlist: New Ideas, Debates and Solutions &#183; Variedades e Bookmarks</dc:creator>
		<pubDate>Sat, 12 Sep 2009 18:18:31 +0000</pubDate>
		<guid isPermaLink="false">http://kilianvalkhof.com/2006/css-xhtml/random-css-thought-math-in-css/#comment-31761</guid>
		<description>[...] but simple math could solve many problems in CSS. An article over on KilianValkof.com titled &quot;Random CSS Thought: Math in CSS&quot; presents just this idea and specific examples of how this could be [...]</description>
		<content:encoded><![CDATA[<p>[...] but simple math could solve many problems in CSS. An article over on KilianValkof.com titled &quot;Random CSS Thought: Math in CSS&quot; presents just this idea and specific examples of how this could be [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
