<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CSSquirrel &#187; css3</title>
	<atom:link href="http://cssquirrel.com/tag/css3/feed/" rel="self" type="application/rss+xml" />
	<link>http://cssquirrel.com/blog</link>
	<description>opinions and news on web design</description>
	<lastBuildDate>Fri, 18 May 2012 16:26:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Square Peg, Round Hole</title>
		<link>http://cssquirrel.com/blog/2010/11/02/square-peg-round-hole/</link>
		<comments>http://cssquirrel.com/blog/2010/11/02/square-peg-round-hole/#comments</comments>
		<pubDate>Tue, 02 Nov 2010 16:40:49 +0000</pubDate>
		<dc:creator>Kyle Weems</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[border-radius]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[rant]]></category>

		<guid isPermaLink="false">http://www.cssquirrel.com/?p=758</guid>
		<description><![CDATA[There is going to be a comic that gets attached to this rant, I assure you. However, I&#8217;m so fired up on the topic at the moment that I&#8217;m tossing this post out sans the punchline. I&#8217;ve used border-radius quite a bit. As far as CSS3 goes, it&#8217;s one of my go-to styles for making [...]]]></description>
			<content:encoded><![CDATA[<p>There is going to be a comic that gets attached to this rant, I assure you. However, I&#8217;m so fired up on the topic at the moment that I&#8217;m tossing this post out sans the punchline.</p>
<p>I&#8217;ve used border-radius quite a bit. As far as CSS3 goes, it&#8217;s one of my go-to styles for making something look snazzy. Just round it and it&#8217;s cool, right? Right?</p>
<p>While working on an internal project for <a title="Mindfly Studio" href="http://mindfly.com/" target="_blank">Mindfly Studio</a>, I found myself grabbing this particular tool for rounding the thumbnail images that were attached with a list of article briefs. When I went to test the results, I found to my dismay that the images were square still, with the rounded borders cutting behind the square of the image.</p>
<p>Then I remembered that I&#8217;d encountered this particular issue before. No problem, I thought to myself. Just wrap that bad-boy in a div (or in this case, an anchor that already existed around the image) and use border-radius on the wrapper. Perfect! Right?</p>
<p>No, sadly.</p>
<p>At this point I felt like my CSS cred was rapidly drying up, and started debating going by JSONSquirrel instead.</p>
<p>&#8220;To the cloud!&#8221; I pronounced, feeling inclined to abuse buzz words, and fired up Twitter. I was informed this was an issue with Firefox (my browser of choice. I like big butts and I cannot lie) but that it&#8217;d be all peachy in Webkit (also known as Apple Browser Jesus in web designer circles).</p>
<p>But as it turns out, Webkit also does it wrong. Less wrong, but wrong.</p>
<p>Here&#8217;s my proof: <a title="Images with Border-Radius Test Page" href="http://cssquirrel.com/testcases/images-with-border-radius/" target="_blank">border-radius test page</a>.</p>
<p>What Webkit does correctly is round the corner of the image itself (when the border-radius property is set for the image, but not the wrapper), but it clips the border if one exists. If placed in a wrapper, like Firefox, it fails altogether.</p>
<p>I tested on the following browsers: Safari 5, Chrome, Firefox 3, Firefox 4 Beta, Opera 10.63, Internet Explorer 8 and Internet Explorer 9 Beta. It&#8217;s no shock that IE8 didn&#8217;t do what I wanted, as it doesn&#8217;t support border-radius at all. Although, humorously enough, their outright failure to round the border (while leaving the image square) was still more aesthetically pleasing than the clipping/overlapping that were the results in Firefox, Webkit and Opera. And yes, Firefox 4 Beta also failed to round the corners as I desired.</p>
<p>Unexpectedly, IE9 Beta did exactly what I desired, which was rounding the image with the border intact (and rounded) with it. The only one, in fact, to do so. That was a shock.</p>
<p>Maybe I&#8217;m expecting this property to do something other than its actual purpose. That said, wouldn&#8217;t an image tag be the most likely case of an element that you&#8217;d want a rounded border to work properly with? It certainly is for me.</p>
<p>I&#8217;m aware that setting a background-image on an element and rounding it is a workaround that functions perfectly. However, if styles are turned off, you lose the image. What if you want the actual image present regardless of whether CSS was present? Well, at present, go with square corners, it seems.</p>
<p>If someone more clever than me comes up with a way around this that is CSS-based (and not overlapping it with a PNG with a rounded hole in it or some other such workaround) then please let me know. I&#8217;d be really curious to see how others tackle this shortcoming.</p>
]]></content:encoded>
			<wfw:commentRss>http://cssquirrel.com/blog/2010/11/02/square-peg-round-hole/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Recap: My Refresh Bellingham Presentation &#8211; The Ghosts of Web Standards Present</title>
		<link>http://cssquirrel.com/blog/2009/12/30/recap-my-refresh-bellingham-presentation-the-ghosts-of-web-standards-present/</link>
		<comments>http://cssquirrel.com/blog/2009/12/30/recap-my-refresh-bellingham-presentation-the-ghosts-of-web-standards-present/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 18:37:57 +0000</pubDate>
		<dc:creator>Kyle Weems</dc:creator>
				<category><![CDATA[Standards]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[refresh bellingham]]></category>
		<category><![CDATA[web standards]]></category>

		<guid isPermaLink="false">http://www.cssquirrel.com/?p=553</guid>
		<description><![CDATA[On December 16th, 2009, I had the opportunity to do something I&#8217;d been meaning to do for a while. I gave a presentation (in front of an audience, even) about web standards! I was invited to speak at Refresh Bellingham, which was a great experience. Discussing the topics of CSS3, HTML5 and Mobile, I definitely [...]]]></description>
			<content:encoded><![CDATA[<p>On December 16th, 2009, I had the opportunity to do something I&#8217;d been meaning to do for a while. I gave a presentation (in front of an audience, even) about web standards! I was invited to speak at <a title="Link to Refresh Bellingham" href="http://refreshbellingham.org/" target="_blank">Refresh Bellingham</a>, which was a great experience. Discussing the topics of CSS3, HTML5 and Mobile, I definitely bit off a larger chunk than I needed to (in the future I think I&#8217;ll pare the experience down to CSS3 and HTML5 unless it&#8217;s for a much longer time format), but by the end of the presentation I felt like I&#8217;d done a good job of entertaining the audience and maybe teaching some of them a thing or two.</p>
<p>And, by George, that was a really good feeling.</p>
<p>Entitled: &#8220;The Ghosts of Web Standards Present: CSS3, HTML5 and Mobile&#8221;, the whole thing ran about an hour and fifteen minutes. Fortunately people laughed at all of my jokes, so it wasn&#8217;t too torturous. I talked about the varying level of support in modern browsers for new CSS3 and HTML5 features (and how that shouldn&#8217;t matter), as well as my thoughts on the need to be ready for mobile devices today in our designs. If I did it again, I&#8217;d probably put more advanced CSS3 techniques and HTML5 tricks in, as I uncovered a whole slew of new things I&#8217;d not experimented with before while doing research for it.</p>
<p>Although the slides don&#8217;t contain the majority of my witty dialog (I&#8217;m so modest), I&#8217;ve put them up (after some corrections and modifications) for you to look at if you&#8217;d like. The background will flash into it&#8217;s proper place two seconds after the page loads, by design (I had some issues with the popdown request for the geolocation interfering with the way the background looked on the slide projector).</p>
<p><a title="Link to my Refresh 2009 presentation" href="/presentations/refresh-2009-12/">The Ghosts of Web Standards Present</a></p>
]]></content:encoded>
			<wfw:commentRss>http://cssquirrel.com/blog/2009/12/30/recap-my-refresh-bellingham-presentation-the-ghosts-of-web-standards-present/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Comic Update: The Return of Bad Taste</title>
		<link>http://cssquirrel.com/blog/2009/10/19/comic-update-the-return-of-bad-taste/</link>
		<comments>http://cssquirrel.com/blog/2009/10/19/comic-update-the-return-of-bad-taste/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 20:56:33 +0000</pubDate>
		<dc:creator>Kyle Weems</dc:creator>
				<category><![CDATA[Comic]]></category>
		<category><![CDATA[bad taste]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[font-face]]></category>

		<guid isPermaLink="false">http://www.cssquirrel.com/?p=481</guid>
		<description><![CDATA[Today&#8217;s comic is not reactive, but rather, predictive. As October is the month where Halloween brings its ghouls, ghosts and other monsters to the mind, I can&#8217;t help but think about the terrors I&#8217;ve seen on the Internet from the days of yore (and sadly yes, even today). Horrible, blighted monstrosities involving the blink and [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Link to CSSquirrel #41: The Return of Bad Taste" href="/comic/?comic=41">Today&#8217;s comic</a> is not reactive, but rather, predictive. As October is the month where Halloween brings its ghouls, ghosts and other monsters to the mind, I can&#8217;t help but think about the terrors I&#8217;ve seen on the Internet from the days of yore (and sadly yes, even today). Horrible, blighted monstrosities involving the <strong>blink</strong> and <strong>marquee</strong> tags, or garish color combinations that unlock portals to the deepest circles of hell.</p>
<p>As someone who is something of a typographic idiot, I can&#8217;t help but wonder what foul, plague-ridden beast I might accidentally birth someday while wielding the power of <strong>@font-face</strong>. And <a title="Link to text-shadow preview at CSS3.Info" href="http://www.css3.info/preview/text-shadow/" target="_blank">this example</a> at CSS3.Info helps highlight the terrors that text-shadow can bring to the modern era.</p>
<p>I&#8217;m not seeking to serve as some sort of doom-saying prophet, but I fear for us all. I&#8217;ve seen what high-school students are producing in their &#8220;web design&#8221; classes (the quotes indicate my sincere lack of confidence). If we don&#8217;t shove some taste down their throats, the inheritor to MySpace&#8217;s throne of bile-filled ineptness may allow even more control over the pages by amateur authors, allowing some sort of vortex of evil that&#8217;ll suck the world&#8217;s light away, leaving a black speck in an empty universe.</p>
<p>So, for the love of all humanity, do us all a favor. Remember this motto: <strong>Friends don&#8217;t let friends use CSS3 without taste.</strong></p>
<p><img style="display:block;margin:1em auto;" src="/images/tmyk.jpg" alt="The More You Know" width="300" height="197" /></p>
]]></content:encoded>
			<wfw:commentRss>http://cssquirrel.com/blog/2009/10/19/comic-update-the-return-of-bad-taste/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>JS Has Always Been Hot, But Now It&#8217;s Sizzling</title>
		<link>http://cssquirrel.com/blog/2008/10/22/js-has-always-been-hot-but-now-its-sizzling/</link>
		<comments>http://cssquirrel.com/blog/2008/10/22/js-has-always-been-hot-but-now-its-sizzling/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 16:37:56 +0000</pubDate>
		<dc:creator>Kyle Weems</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[eric meyer]]></category>
		<category><![CDATA[sizzle]]></category>

		<guid isPermaLink="false">http://www.cssquirrel.com/?p=126</guid>
		<description><![CDATA[Eric Meyer wrote a little post about new project in development by John Resig called Sizzle that should be making every web designer wet themselves. He&#8217;s really excited about this. Almost to the point where in my mind&#8217;s eye I can see him skipping down hallways. How excited? &#8220;I’m absolutely going to use it and [...]]]></description>
			<content:encoded><![CDATA[<p>Eric Meyer wrote a little <a title="Meyerweb blog post - JavaScript Will Save Us All" href="http://meyerweb.com/eric/thoughts/2008/10/22/javascript-will-save-us-all/" target="_blank">post</a> about new project in development by <a title="Link to John Resig's website" href="http://ejohn.org/" target="_blank">John Resig</a> called <a title="Link to Sizzle project" href="http://github.com/jeresig/sizzle/tree/master" target="_self">Sizzle</a> that should be making every web designer wet themselves. He&#8217;s really excited about this. Almost to the point where in my mind&#8217;s eye I can see him skipping down hallways. How excited?</p>
<blockquote><p><em>&#8220;I’m absolutely going to use it and recommend its use far and wide.&#8221;</em></p></blockquote>
<p>Sounds pretty excited to me. What is all this enthusiasm being caused by? What is Sizzle?</p>
<p><span id="more-126"></span></p>
<p>I&#8217;m still catching up on the details as I write this, but in essence it&#8217;s a JavaScript project that will take advanced CSS selectors (read that, CSS3 selectors with little to no current browser support), do some work behind the mysterious veil, and then spit out the results on the browser. Any browser.</p>
<p>As a designer all you&#8217;d have to do is write your stylesheets with these new selectors (and possibly new properties like multiple-backgrounds, although I&#8217;m still confirming that), and let JS do the rest.</p>
<p>This is hot. It&#8217;s taking all the work that has been put into making JS engines these days smokingly hot, and converting that effort into some benefit for CSS, which isn&#8217;t getting the same fast-track treatment we&#8217;ve been desiring. I goofed around with a similar concept with a pseudo-class to class CSS converter called Pseudonut, but this is a whole other beast, and I&#8217;m really looking forward to it.</p>
]]></content:encoded>
			<wfw:commentRss>http://cssquirrel.com/blog/2008/10/22/js-has-always-been-hot-but-now-its-sizzling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I want my CSS3-provided rounded corners</title>
		<link>http://cssquirrel.com/blog/2008/05/10/css3-rounded-corners/</link>
		<comments>http://cssquirrel.com/blog/2008/05/10/css3-rounded-corners/#comments</comments>
		<pubDate>Sun, 11 May 2008 04:04:35 +0000</pubDate>
		<dc:creator>Kyle Weems</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css3]]></category>

		<guid isPermaLink="false">http://www.cssquirrel.com/?p=22</guid>
		<description><![CDATA[Every time I have to slave away at a CSS solution to a problem that could be easily solved by CSS3&#8242;s multiple backgrounds or border-radius, I want to inflict harm upon myself. This is exasperated by the number of rounded corner designs I seem to be working on today. (Are those currently in, out, or [...]]]></description>
			<content:encoded><![CDATA[<p>Every time I have to slave away at a CSS solution to a problem that could be easily solved by CSS3&#8242;s <a title="Link to CSS3 post about multiple-backgrounds" href="http://www.css3.info/preview/multiple-backgrounds/" target="_blank">multiple backgrounds</a> or <a title="Andy Bludd talks about border-radius" href="http://24ways.org/2006/rounded-corner-boxes-the-css3-way" target="_blank">border-radius</a>, I want to inflict harm upon myself. This is exasperated by the number of rounded corner designs I seem to be working on today. (Are those currently in, out, or tacky?)</p>
<p>At the moment, the only notable (sorry Konqueror) browser to support both is Webkit (Safari). Firefox supports border-radius, but neither IE or Opera support either. Granted, Opera&#8217;s percentage of the browser population doesn&#8217;t make its feature set a deal breaker, but it&#8217;s simply impossible to put these solutions into play when IE&#8217;s massive user-base can&#8217;t see them.</p>
<p>*sigh*</p>
<p>I&#8217;d be less melancholy about it if Internet Explorer 8 was going to bring at least one of these with it. But no, that would be too nice.</p>
<p>It annoys me that out of the various improvements CSS3 is supposed to bring to the table that these two are so far away from implementation. The amount of presentation-only markup (the great enemy that CSS is meant to fight) that would be eliminated is immense.</p>
<p>That&#8217;s alright. I don&#8217;t mind putting three to five elements on a page where I should only need one.</p>
<p>I&#8217;m going to go get some warm milk and cry myself to sleep.</p>
]]></content:encoded>
			<wfw:commentRss>http://cssquirrel.com/blog/2008/05/10/css3-rounded-corners/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS3 Attribute Selectors: So Hot Right Now</title>
		<link>http://cssquirrel.com/blog/2008/05/01/css3-attribute-selectors-so-hot-right-now/</link>
		<comments>http://cssquirrel.com/blog/2008/05/01/css3-attribute-selectors-so-hot-right-now/#comments</comments>
		<pubDate>Thu, 01 May 2008 16:05:01 +0000</pubDate>
		<dc:creator>Kyle Weems</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[attribute selectors]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[ie7]]></category>
		<category><![CDATA[sitepoint]]></category>

		<guid isPermaLink="false">http://www.cssquirrel.com/?p=14</guid>
		<description><![CDATA[As discussed here, I&#8217;m really getting into CSS3 Attribute Selectors. As mentioned earlier in my Yo-Yo post, I&#8217;ve been looking into solutions to make these guys more accessible, and I&#8217;ve come full circle to realize that I don&#8217;t need to do anything extra to incorporate them in my website and have users see them in [...]]]></description>
			<content:encoded><![CDATA[<p>As discussed <a title="CSS3 Attribute Selector blog entry at Mindfly.com" href="http://www.mindfly.com/blog/post.aspx?id=d934e89e-da1f-48cb-aaf7-12876d5c278f" target="_blank">here</a>, I&#8217;m really getting into <a title="SitePoint CSS Reference entry on CSS3 Attribute Selectors" href="http://reference.sitepoint.com/css/css3attributeselectors" target="_blank">CSS3 Attribute Selectors</a>. As mentioned earlier in my Yo-Yo post, I&#8217;ve been looking into solutions to make these guys more accessible, and I&#8217;ve come full circle to realize that I don&#8217;t need to do anything extra to incorporate them in my website and have users see them in any major browser. This is because:</p>
<p>1. The modern versions of Internet Explorer, Firefox, Safari, and Opera all support them. (Here&#8217;s a <a title="CSS3 Attribute Selector Test Page" href="http://www.mindfly.com/uploads/testcases/attribute_selectors/attribute_selectors.html" target="_blank">test page</a> at <a title="Link to Mindfly" href="http://www.mindfly.com/" target="_blank">Mindfly</a>&#8216;s website to prove the point).</p>
<p>2. The <a title="Link to Dean Edwards IE7" href="http://dean.edwards.name/IE7/" target="_blank">Dean Edwards IE7</a> script DOES extend full CSS3 attribute selector support to IE6 (I&#8217;m guessing my earlier tests had an error, because now I&#8217;m showing full compliance with this <a title="Link to a CSS3 attributes selector test page with IE7 script" href="http://www.mindfly.com/uploads/testcases/attribute_selectors/attribute_selectors2.html" target="_blank">second test page</a> that includes that script (once again, at Mindfly).</p>
<p>The CSS3 features I&#8217;m really looking for support for now, then, are the <a title="SitePoint CSS Reference entry on CSS3 Pseudoclasses" href="http://reference.sitepoint.com/css/css3psuedoclasses" target="_blank">CSS3 pseudoclasses</a> and multiple background images. *drool* Multiple background images alone would help cut down on my markup immensely, making features such as rounded boxes so much less of a pain in the arse.</p>
]]></content:encoded>
			<wfw:commentRss>http://cssquirrel.com/blog/2008/05/01/css3-attribute-selectors-so-hot-right-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yo-Yo</title>
		<link>http://cssquirrel.com/blog/2008/04/24/yo-yo/</link>
		<comments>http://cssquirrel.com/blog/2008/04/24/yo-yo/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 20:11:03 +0000</pubDate>
		<dc:creator>Kyle Weems</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[attribute selectors]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[dean edwards]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[ie7]]></category>

		<guid isPermaLink="false">http://www.cssquirrel.com/?p=11</guid>
		<description><![CDATA[I&#8217;ve been getting more obsessed with attribute selectors these days. They do such delightful things, and really help me cut down on the markup I need for a site. The problem, of course, is browser compatibility. So I started working on some javascript to give IE7 the functionality for CSS3 attribute selectors. Then I discovered [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been getting more obsessed with attribute selectors these days. They do such delightful things, and really help me cut down on the markup I need for a site. The problem, of course, is browser compatibility. So I started working on some javascript to give IE7 the functionality for CSS3 attribute selectors.</p>
<p>Then I discovered to my total shock that IE7 actually does support CSS3 attribute selectors.</p>
<p>Someone should tell Sitepoint this, as their reference incorrectly states that it does not.</p>
<p>However, IE6 doesn&#8217;t support ANY attribute selectors, so I went to the blackboard again to write a script for that.</p>
<p>Then I discovered that Dean Edwards&#8217; IE7 script <em>does </em>give IE6 attribute support. So I stopped writing my own script and went to check that out.</p>
<p>A while later, I discovered that the Dean Edwards script, however, does not give <em>full </em>support to IE6 for css3 attribute selectors. (Most notably, *= doesn&#8217;t seem to work).</p>
<p>So now I&#8217;m working on that script again.</p>
<p>I think I&#8217;m beginning to understand what a yo-yo feels like.</p>
]]></content:encoded>
			<wfw:commentRss>http://cssquirrel.com/blog/2008/04/24/yo-yo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solving Impatience with Pseudonut</title>
		<link>http://cssquirrel.com/blog/2008/03/02/solving-impatience-with-pseudonut/</link>
		<comments>http://cssquirrel.com/blog/2008/03/02/solving-impatience-with-pseudonut/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 04:56:59 +0000</pubDate>
		<dc:creator>Kyle Weems</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[pseudonut]]></category>

		<guid isPermaLink="false">http://www.cssquirrel.com/2008/03/02/solving-impatience-with-pseudonut/</guid>
		<description><![CDATA[I tried really hard to start this post with a pop culture reference that somehow allegorically tied Alan Ruck&#8216;s relative anonymity despite his years of acting (including a major role in the pinnacle of 80&#8242;s teen films: Ferris Bueller&#8217;s Day Off) to the subject of toiling away at web design solutions on a daily basis. [...]]]></description>
			<content:encoded><![CDATA[<p>I tried really hard to start this post with a pop culture reference that somehow allegorically tied <a href="http://en.wikipedia.org/wiki/Alan_Ruck" title="Alan Ruck's Wikipedia article" target="_blank">Alan Ruck</a>&#8216;s relative anonymity despite his years of acting (including a major role in the pinnacle of 80&#8242;s teen films: <a href="http://www.imdb.com/title/tt0091042/" title="Ferris Bueller's Day Off on IMDb" target="_blank"><em>Ferris Bueller&#8217;s Day Off</em></a>) to the subject of toiling away at web design solutions on a daily basis. After reading what I just wrote, I realize that I may have too much spare time on my hands.</p>
<p>Fortunately for me, I spend at least a little of that time doing other things, like actually working on previously mentioned web design solutions. One area of interest that I&#8217;ve been getting more and more obsessed with is using Javascript to allow cross-browser CSS3 functionality on modern browsers, despite the fact that short of <a href="http://www.konqueror.org/" title="Konquerer" target="_blank">Konquerer</a>, (which really annoys me because of the &#8216;cool&#8217; spelling of a word with the letter K) browsers probably won&#8217;t be doing a lot of note with CSS3 until sometime after global warming causes the seas to rise and dolphins enslave humanity.</p>
<p><span id="more-5"></span>As much as I look forward to designing amazing tuna-oriented websites under the strict guidance of our future dolphin overlords, I&#8217;m not realy interested in waiting any longer to get my hands on all the cool features of CSS3 that have been &#8220;on the horizon&#8221; for half a decade now. I&#8217;ve talked about this lack of patience before, discussing the ability to use CSS3&#8242;s multi-column features today with <a href="http://www.veerwest.com/" rel="nofollow" target="_blank" title="http://www.veerwest.com">Cédric Savarese&#8217;s</a> <a href="http://www.csscripting.com/css-multi-column/" title="css3 multi-column javascript" target="_blank">css3-multi-column.js</a> (which I offered a slightly altered version of <a href="http://www.mindfly.com/blog/post.aspx?id=dd42ba83-5c29-40df-9453-dcc4583f5cab" title="The CSS Working Group Explosion and Taking Multi-Column Support Into Your Own Hands" target="_blank">here</a>) and adding some CSS3-like pseudo-class mimicking support with <a href="http://www.handcoding.com/" title="Alex Bischoff" target="_blank">Alex Bischoff</a>&#8216;s Offspring.js (introduce in a List Apart&#8217;s article <a href="http://www.alistapart.com/articles/keepelementskidsinlinewithoffspring" target="_blank">Keeping Your Elements&#8217; Kids in Line with Offspring</a>, which I talk about <a href="http://www.mindfly.com/blog/post.aspx?id=5e99508e-e403-4b20-ab88-cec4a5bc39b3" title="Tasty Offspring" target="_blank">here</a>).</p>
<p>At some point, while I was sitting in Andy Clarke&#8217;s workshop at Web Directions North 2008 and dreamily drawing <a href="http://www.cssquirrel.com/images/andysketch.jpg" title="Bad Sketch of Andy Clarke" target="_blank">sketches</a> of everyone&#8217;s favorite<a href="http://www.stuffandnonsense.co.uk/" title="Stuff And Nonsense" target="_blank"> CSS rockstar</a>, Andy talked about how it&#8217;s important to make use of cutting edge CSS features as often as possible to bring the browser makers&#8217; attention to the fact that there is demand for support of these features. I think he was pushing in the right direction, but I think it&#8217;s not just enough to use modern browser support. I think people like Cédric and Alex are making strides in the right territory, which is using Javascript to implement CSS3 <strong>today</strong>.</p>
<p>Realizing it&#8217;d be a bunch of noise to just preach it without practicing, I&#8217;ve thrown my hat into the ring. My Javascript is a lot less practiced than my CSS, so I&#8217;m not exactly rocketing to the top with a killer script. However, they&#8217;re not nonexistent either, so I&#8217;ve put my nose to the grindstone.</p>
<p>The first challenge I decided to tackle was to fix an issue that I have with <a href="http://code.google.com/p/offspringjs/" title="Offspring at Google Code" target="_blank">offspring.js</a>. The script does a great (some might say <em>overly thorough</em>) job with adding classes to each element on the page so that they can be targeted with &#8220;pseudo-class&#8221;-like classes such as &#8220;.first-child&#8221;, &#8220;.last-child&#8221;, and &#8220;.nth-child&#8221; (it only currently supports the &#8220;odd&#8221;, &#8220;even&#8221;, and &#8220;#&#8221; values for nth-child). But to use these, you have to mark your CSS up with <em>classes </em>(such as &#8220;.last-child&#8221;) instead of <em>pseudo-classes</em> (such as &#8220;:last-child&#8221;). This is all great and dandy while modern browsers don&#8217;t have up-to-date CSS3 support. But as soon as they do (which, considering IE&#8217;s pace of advancement will be somewhere near 2020) you&#8217;d have to go through all your stylesheets and convert the styles to the proper pseudo-classes.</p>
<p>Not anymore. Let me introduce you to <strong>Pseudonut</strong>, a small script that goes through your stylesheets, checks for CSS3 pseudo-class selectors (currently only last-child, first-child, only-child, and nth-child) and then updates the stylesheets with new rules using classes instead. This means that you can drop the script into a project, use the supported CSS3 pseudo-classes, and it&#8217;ll convert them to a format for use with Offspring or any similar script you have.</p>
<p>Although it was my hope to use Javascript&#8217;s <strong>document.styleSheets.cssRules</strong> to read the existing selectors, strip out the pseudo-classes, and then replace them with classes, I ran into a major hurdle right away. Namely, most of the browsers wouldn&#8217;t actually read the pseudo-class marked selectors, as they&#8217;d see a style that held something they didn&#8217;t understand and therefore not add it to the list of <strong>cssRules</strong>. So instead I&#8217;m loading the stylesheets with <strong>XMLHttpRequest</strong>, splitting it into an array of strings holding the selectors and styles, making the changes from pseudo-class to class, then using javascript&#8217;s <strong>document.styleSheets.insertRule</strong> (or addRule if the viewer is using IE, since it has to be a special snowflake) to add the updated rule.</p>
<p>Here&#8217;s an <a href="http://www.cssquirrel.com/testcases/pseudonut/pseudonut.html" title="Pseudonut Test" target="_blank">example</a> of it in work (I recommend checking out the stylesheets and html in Firebug). I&#8217;m using Offspring.js for adding the proper classes to the HTML, but you could use any script of your own for that feature.</p>
<p>Here&#8217;s the Javascript file: <a href="http://www.cssquirrel.com/testcases/pseudonut/pseudonut.js" title="Pseudonut.js" target="_blank">pseudonut.js</a>.</p>
<p>Here&#8217;s the CSS file for that test: <a href="http://www.cssquirrel.com/testcases/pseudonut/pseudonut.css" title="Pseudonut.css" target="_blank">pseudonut.css</a>.</p>
<p>Before I get reamed by Javascript experts for the cleanliness of the code (or lack thereof), I&#8217;d like to advise that this is what I&#8217;m calling version 0.1. It&#8217;s raw, it&#8217;s new, and it&#8217;s going to need a lot of polish.  In particular I&#8217;m already thinking I should have loaded all the different pseudo-classes into an array of strings instead of checking for each separately. This is just the tip of the iceberg, though. Here&#8217;s a list of upgrades I plan for the project.</p>
<ul>
<li>Add configuration features so you can choose which pseudo-classes to support.</li>
<li>Add support for all of <a href="http://reference.sitepoint.com/css/css3psuedoclasses" title="Sitepoint's CSS Reference - CSS3 Pseudo-class selectors" target="_blank">CSS3&#8242;s pseudo-classes</a>.</li>
<li>Add the functionality to insert the needed classes into the HTML tags so that Pseudonut can stand alone without offspring (and ideally design it to only add extra classes to elements to tags that&#8217;ll need them, rather than Offspring&#8217;s jackhammer approach of banging them all), including full nth-child support.</li>
<li>Add support for <a href="http://reference.sitepoint.com/css/css3attributeselectors" title="Sitepoint's CSS Reference - CSS3 Attribute selectors" target="_blank">CSS3 attribute selectors</a>.</li>
</ul>
<p>Pseudonut is filling its initial purpose, which is to allow me to keep my stylesheets &#8220;clean&#8221; while still being able to make use of the features offered by Offspring and other such scripts. Going forward, I&#8217;m definitely open to suggestions or comments regarding whether such a thing is needed, and if so, what kind of changes or direction should occur.</p>
<p>Oh, and for those of you who are too young to have experienced Ferris Bueller&#8217;s Day Off, go watch it, if for no other reason than to be grateful that women don&#8217;t use as much hairspray today.</p>
]]></content:encoded>
			<wfw:commentRss>http://cssquirrel.com/blog/2008/03/02/solving-impatience-with-pseudonut/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nekkid!</title>
		<link>http://cssquirrel.com/blog/2008/02/14/nekkid/</link>
		<comments>http://cssquirrel.com/blog/2008/02/14/nekkid/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 20:45:10 +0000</pubDate>
		<dc:creator>Kyle Weems</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.cssquirrel.com/?p=3</guid>
		<description><![CDATA[My so-called social calendar has suddenly filled up right after uploading all my blog software. So although this site will eventually look customized, sleek, and entirely different, for the moment it&#8217;ll have to look just like a really nekkid blog. Misspelling words on purpose, how enjoyable! My current CSS tomfoolery involves creating a javascript file [...]]]></description>
			<content:encoded><![CDATA[<p>My so-called social calendar has suddenly filled up right after uploading all my blog software. So although this site will eventually look customized, sleek, and entirely different, for the moment it&#8217;ll have to look just like a really nekkid blog.</p>
<p>Misspelling words on purpose, how enjoyable!</p>
<p>My current CSS tomfoolery involves creating a javascript file that can convert proper CSS3 selector pseudoclasses like :nth-child(#) into Offspring-compatible fake pseudoclasses like &#8220;.nth-child-#&#8221;. It&#8217;s about 80% there, but I&#8217;ve ran into an issue where JS doesn&#8217;t recognize a selector as a selector if it&#8217;s got &#8220;(&#8221; or &#8220;)&#8221; in it, which is what nth-child makes heavy use of. If I can&#8217;t conceive of a workaround, it&#8217;ll tank the mini-project. Arrr&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://cssquirrel.com/blog/2008/02/14/nekkid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

