<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Paul Irish</title>
	
	<link>http://paulirish.com</link>
	<description>I make the www fun.</description>
	<pubDate>Mon, 30 Aug 2010 23:04:09 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/paul-irish" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="paul-irish" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Announcing: HTML5 Boilerplate</title>
		<link>http://paulirish.com/2010/announcing-html5-boilerplate/</link>
		<comments>http://paulirish.com/2010/announcing-html5-boilerplate/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 19:05:17 +0000</pubDate>
		<dc:creator>Paul Irish</dc:creator>
		
		<category><![CDATA[front-end development]]></category>

		<guid isPermaLink="false">http://paulirish.com/?p=852</guid>
		<description><![CDATA[
When kicking off a new project, I&#039;ve always wanted to take with me all the kickass tricks I learned on the previous one. This project has been on and off for the last 2.5 years with a whole lot of on lately. Finally, HTML5 Boilerplate is ready to share.
It&#039;s essentially a good starting template of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://html5boilerplate.com/"><img src="http://paulirish.com/wp-content/uploads/2010/08/html5boilerplate_ss.png" style="display:block; margin: 0 auto; padding: 10px; border: 1px solid #eee;"></a></p>
<p>When kicking off a new project, I&#039;ve always wanted to take with me all the kickass tricks I learned on the previous one. This project has been on and off for the last 2.5 years with a whole lot of <em>on</em> lately. Finally, <a href="http://html5boilerplate.com/">HTML5 Boilerplate</a> is ready to share.</p>
<p>It&#039;s essentially a good starting template of html and css and a folder structure that works. But baked into it is years of best practices from front-end development professionals. Take a <a href="http://github.com/paulirish/html5-boilerplate">peek through the source</a> to get a feel of what&#039;s inside. And if you think there&#039;s too much? Delete key that badboy.</p>
<p>I&#039;m very interested in your contributions.. what else deserves to be in this base template?</p>
]]></content:encoded>
			<wfw:commentRss>http://paulirish.com/2010/announcing-html5-boilerplate/feed/</wfw:commentRss>
		</item>
		<item>
		<title>High-res browser logos</title>
		<link>http://paulirish.com/2010/high-res-browser-icons/</link>
		<comments>http://paulirish.com/2010/high-res-browser-icons/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 16:21:42 +0000</pubDate>
		<dc:creator>Paul Irish</dc:creator>
		
		<category><![CDATA[front-end development]]></category>

		<guid isPermaLink="false">http://paulirish.com/?p=839</guid>
		<description><![CDATA[You may want these for a presentation, a, blog post or for the site featuring your brand new awesome lightbox script (please no!). They are 32bit PNGs, each have their own official shadow treatment, and no background matte color.
256 x 256

128 x 128

64 x 64

32 x 32

16 x 16

The smaller sizes are all scaled down [...]]]></description>
			<content:encoded><![CDATA[<p>You may want these for a presentation, a, blog post or for the site featuring your brand new awesome lightbox script <small>(please no!)</small>. They are 32bit PNGs, each have their own official shadow treatment, and no background matte color.</p>
<p><b>256 x 256</b><br />
<a href="http://paulirish.com/lovesyou/browser_logos-256.png"><img src="http://paulirish.com/lovesyou/browser_logos-256.png" style="max-width: none;"></a></p>
<p><b>128 x 128</b><br />
<a href="http://paulirish.com/lovesyou/browser_logos-128.png"><img src="http://paulirish.com/lovesyou/browser_logos-128.png" style="max-width: none;"></a></p>
<p><b>64 x 64</b><br />
<a href="http://paulirish.com/lovesyou/browser_logos-64.png"><img src="http://paulirish.com/lovesyou/browser_logos-64.png"></a></p>
<p><b>32 x 32</b><br />
<a href="http://paulirish.com/lovesyou/browser_logos-32.png"><img src="http://paulirish.com/lovesyou/browser_logos-32.png"></a></p>
<p><b>16 x 16</b><br />
<a href="http://paulirish.com/lovesyou/browser_logos-16.png"><img src="http://paulirish.com/lovesyou/browser_logos-16.png"></a></p>
<p><small>The smaller sizes are all scaled down instead of taking the true icon assets. If you would like to create proper non-scaled small sizes, I&#039;d gladly accept them. :)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://paulirish.com/2010/high-res-browser-icons/feed/</wfw:commentRss>
		</item>
		<item>
		<title>10 Things I Learned from the jQuery Source</title>
		<link>http://paulirish.com/2010/10-things-i-learned-from-the-jquery-source/</link>
		<comments>http://paulirish.com/2010/10-things-i-learned-from-the-jquery-source/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 15:56:43 +0000</pubDate>
		<dc:creator>Paul Irish</dc:creator>
		
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://paulirish.com/?p=814</guid>
		<description><![CDATA[Last weekend was the incredible TXJS conference. It was a grand time in hot hot Texas. Joe Bartlett has a great conference roundup, rebecca&#039;s pix are quite pretty, and most of the speaker slides are on the official site.
I&#039;ve rerecorded my talk in screencast form. Here&#039;s what to expect from the 52 minute video:
It&#8217;s jQuery [...]]]></description>
			<content:encoded><![CDATA[<p>Last weekend was the incredible <a href="http://texasjavascript.com/">TXJS conference</a>. It was a grand time in hot hot Texas. Joe Bartlett has a great <a href="http://jdbartlett.github.com/2010/06/10/txjs-good/">conference roundup</a>, <a href="http://www.flickr.com/photos/rdmey/sets/72157624208689340/detail/">rebecca&#039;s pix</a> are quite pretty, and most of the <a href="http://texasjavascript.com/">speaker slides</a> are on the official site.</p>
<p>I&#039;ve rerecorded my talk in screencast form. Here&#039;s what to expect from the 52 minute video:</p>
<blockquote><p>It&rsquo;s jQuery on the big screen. We&rsquo;ll open the jQuery source and run through how the jQuery object works, covering self-executing anonymous functions as a global abatement technique, several interesting jQuery methods, internal jQuery paradigms, and hiddenhancements. You&rsquo;ll learn JavaScript techniques you can apply to your own code, as well as the basic workings of jQuery itself.</p></blockquote>
<p>Enjoy. Please comment if you have a question or if I messed something up. :)<br />
<object width="599" height="337"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=12529436&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=0&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=12529436&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=0&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="599" height="337"></embed></object><br />
<small><a href="http://www.youtube.com/watch?v=i_qE1iAmjFg">youtube hosted version here</a></small></p>
<div class="update">2010.07.21: <a href="http://www.keyframesandcode.com/resources/javascript/jQuery/deconstructed/">jQuery Deconstructed</a> is a rather nice way to look through the source. Also, the <a href="http://james.padolsey.com/jquery/">jQuery Source Viewer</a>. </div>
<p>Also, <small>(you should already know this, but&#8230;)</small> if you like this screencast you should subscribe to the <a href="http://yayquery.com">yayQuery Podcast</a>. It&#039;s techy but entertaining and there will be smiles.</p>
]]></content:encoded>
			<wfw:commentRss>http://paulirish.com/2010/10-things-i-learned-from-the-jquery-source/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Details on the new Google Webfont API</title>
		<link>http://paulirish.com/2010/details-on-the-new-google-webfont-api/</link>
		<comments>http://paulirish.com/2010/details-on-the-new-google-webfont-api/#comments</comments>
		<pubDate>Wed, 19 May 2010 17:12:51 +0000</pubDate>
		<dc:creator>Paul Irish</dc:creator>
		
		<category><![CDATA[front-end development]]></category>

		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://paulirish.com/?p=777</guid>
		<description><![CDATA[As you might have see, Google now offers a full webfont API. Luckily, they let me dig into the service and code a few weeks back. So let me give you the lowdown on the features and what you can do with it&#8230;
Here&#039;s adding a @font-face declaration for Tangerine, a nice scripty font:

&#60;link rel=&#34;stylesheet&#34; href=&#34;http://fonts.googleapis.com/css?family=Tangerine&#34;&#62;

You&#039;ll [...]]]></description>
			<content:encoded><![CDATA[<p>As you might have see, <a href="https://code.google.com/apis/webfonts/">Google now offers a full webfont API</a>. Luckily, they let me dig into the service and code a few weeks back. So let me give you the lowdown on the features and what you can do with it&#8230;</p>
<p>Here&#039;s adding a @font-face declaration for Tangerine, a nice scripty font:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://fonts.googleapis.com/css?family=Tangerine&quot;</span>&gt;</span></pre></div></div>

<p>You&#039;ll then reference it <code>font-family:Tangerine</code> and be all set.   As for something a bit more complicated:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://fonts.googleapis.com/css?family=Inconsolata:italic,bolditalic|Droid+Sans&quot;</span>&gt;</span></pre></div></div>

<p>There&#039;s Inconsolata regular, italic and bold-italic and Droid Sans regular.</p>
<p>There is a <a href="http://code.google.com/webfonts">high-quality curated portfolio</a> of open fonts available (Raph Levien, designer of <a href="http://www.levien.com/type/myfonts/inconsolata.html">Inconsolata</a> guided this project). And view the <a href="https://code.google.com/apis/webfonts/docs/getting_started.html">real documentation on the CSS api</a>.</p>
<p>Obviously there are huge caching benefits to using the Google Font API, plus they&#039;re very focused on performance and you can expect things to be fast and <a href="http://paulirish.com/2009/fighting-the-font-face-fout/">FOUT</a> to be minimized. But on the topic of FOUT&#8230;</p>
<p><strong>The <a href="https://code.google.com/apis/webfonts/docs/webfont_loader.html">WebFont Loader</a> is also making its debut. </strong>This is a javascript library collaboration between the good boys at <a href="http://typekit.com">Typekit</a> and Google. It basically allows a lot of control over the display details of webfonts.</p>
<p>Let&#039;s say you want Firefox to not have the FOUT, but rather <strong>mimic webkit&#039;s behavior of invisible text </strong>until the font is loaded:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
  WebFont.load({
    google: {
      families: ['Cantarell']
    }
  });
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">style</span>&gt;</span>
  .wf-loading h1 { visibility: hidden; }
  .wf-active h1, .wf-inactive h1 { 
    visibility: visible; font-family: 'Cantarell'; 
  }
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">style</span>&gt;</span></pre></div></div>

<p>The WebFont Loader API provides some classes on the <code>&lt;html></code> element (a la Modernizr) and a bunch of <a href="https://code.google.com/apis/webfonts/docs/webfont_loader.html#Events">javascript callbacks</a>.</p>
<p><a href="http://paulirish.com:5678/">Check out all the WebFont demos</a>, showing off all its capabilities. One of my favorite parts is that you can use the events and hooks it provides <a href="http://paulirish.com:5678/custom.html">with your very own hosted fonts</a> (in that demo I load Taggeschrift from paulirish.com). </p>
<p>The webfont loader is <a href="http://github.com/typekit/webfontloader">now an open-source project on github</a>. Feel free to peek under the covers. Oh and do check the project docs: <a href="http://code.google.com/apis/webfonts/docs/getting_started.html">getting started</a>, <a href="https://code.google.com/apis/webfonts/docs/webfont_loader.html">webfont loader</a>, <a href="https://code.google.com/apis/webfonts/docs/technical_considerations.html">technicalities</a>, and <a href="https://code.google.com/apis/webfonts/faq.html">faq</a>.</p>
<p>Ask any questions in the comments and I&#039;ll do my best to clarify. :)</p>
<div class="update">2010.05.19: The <a href="http://code.google.com/webfonts/preview">Google webfont previewer tool</a> (with jQuery!) is pretty tight, too.</p>
<p>2010.05.20: Update via Florian to use .wf-loading to hide for FOUT prevention.</p></div>
<div class="readmore">Take a look at some of my other <small>(recently updated)</small> webfont stuff:</p>
<ul>
<li><a href="http://paulirish.com/2010/font-face-gotchas/">@font-face gotchas</a></li>
<li><a href="http://paulirish.com/2009/fighting-the-font-face-fout/">Fighting the @font-face FOUT</a></li>
<li><a href="http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/">Bulletproof @font-face syntax</a></li>
<li><a href="http://paulirish.com/2009/squeeze/">Web Typography Presentations</a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://paulirish.com/2010/details-on-the-new-google-webfont-api/feed/</wfw:commentRss>
		</item>
		<item>
		<title>My harmonious background canvas</title>
		<link>http://paulirish.com/2010/my-harmonious-background-canvas/</link>
		<comments>http://paulirish.com/2010/my-harmonious-background-canvas/#comments</comments>
		<pubDate>Mon, 17 May 2010 18:23:20 +0000</pubDate>
		<dc:creator>Paul Irish</dc:creator>
		
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://paulirish.com/?p=760</guid>
		<description><![CDATA[So I happened upon squaredesign site and was impressed by their trippy background squares that responded to mouse movement (tutorial here).
Illustration done with HarmonyI got jealous and wanted my own interactive background. Plus @miketaylr&#039;s is mad sweet. Turns out, I&#039;m lazy. Never fear. Mr Doob recently put out the magical canvas procedural illustration application Harmony [...]]]></description>
			<content:encoded><![CDATA[<p>So I happened upon <a href="http://squaredesign.com">squaredesign</a> site and was impressed by their trippy background squares that responded to mouse movement (<a href="http://squaredesign.com/lab/crazy-squares/">tutorial here</a>).</p>
<p><figure  style="float: right; width: 140px"><a href="http://mrdoob.com/projects/harmony"><img title="artwork done with Harmony" align="right" src="http://paulirish.com/wp-content/uploads/2010/05/he-copysm.jpg" width="140" height="167"></a><figcaption><a href="http://cmart.livejournal.com/495296.html">Illustration</a> done with <a href="http://mrdoob.com/projects/harmony">Harmony</a></figcaption></figure>I got jealous and wanted my own interactive background. Plus <a href="http://miketaylr.com/">@miketaylr&#039;s is mad sweet</a>. Turns out, I&#039;m lazy. Never fear. <a href="http://mrdoob.com/blog/post/689">Mr Doob recently put out</a> the <a href="http://mrdoob.com/projects/harmony/">magical canvas procedural illustration application Harmony</a> and generously licensed it MIT.</p>
<p>I adapted the code for use as a background, but felt like it still missed something.<ins> It needed an easter egg. </ins>Oh yes. Taking inspiration from the <a href="http://knowyourmeme.com/memes/harmony-harmony">Harmony Harmony meme</a> (<a href="http://paulirish.com/wp-content/uploads/2010/05/1267687412607.png">example</a>), I decided an Erasure music video was in order. </p>
<p>Leveraging code from the <a href="http://depts.washington.edu/aimgroup/proj/dollar/">$1 Unistroke Recognizer</a> (which is righteous), it takes snapshots between drawing pauses and looks to see if you drew a star. If it thinks you did.. then:</p>
<p><img src="http://paulirish.com/wp-content/uploads/2010/05/2b50.jpg" title="i draw pretty poorly. i accept screenshots to replace this one :)"></p>
<p>The code for the bg integration is on github: <a href="http://github.com/paulirish/harmony">/paulirish/harmony</a><br />
The code for <a href="http://mrdoob.com/projects/harmony/">doob&#039;s harmony app</a> is on github, too: <a href="http://github.com/mrdoob/harmony">/mrdoob/harmony</a></p>
<p>Take it for a spin if you like. Experiment with some of the other brushes. Thanks again to <a href="http://twitter.com/mrdoob">powerhouse Mr Doob</a> for sharing such beautiful work.</p>
<p><small>(I&#039;ll probably be removing the drawing canvas in a week or so. It&#039;s a bit of a resource hog!)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://paulirish.com/2010/my-harmonious-background-canvas/feed/</wfw:commentRss>
		</item>
		<item>
		<title>@font-face gotchas</title>
		<link>http://paulirish.com/2010/font-face-gotchas/</link>
		<comments>http://paulirish.com/2010/font-face-gotchas/#comments</comments>
		<pubDate>Wed, 05 May 2010 18:35:43 +0000</pubDate>
		<dc:creator>Paul Irish</dc:creator>
		
		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://paulirish.com/?p=588</guid>
		<description><![CDATA[Over the past few months, I&#039;ve collected a few worthwhile notes on @font-face that are worth reading over if you geek out about this stuff&#8230;

in Webkit (Chrome/Safari), applying font-weight:bold to faux-bold some @font-face&#039;d text will not succeed. Same applies for font-style:italic. You can fix by adding the following to your @font-face declaration: (via doctype, crbug/31883, [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past few months, I&#039;ve collected a few worthwhile notes on @font-face that are worth reading over if you geek out about this stuff&#8230;</p>
<ul>
<li>in Webkit (Chrome/Safari), applying <code>font-weight:bold</code> to faux-bold some @font-face&#039;d text will not succeed. Same applies for <code>font-style:italic</code>. You can fix by adding the following to your @font-face declaration: <small>(via <a href="http://doctype.com/font-showing-bold-only-chromesafari#answer_4287">doctype</a>, <a href="http://code.google.com/p/chromium/issues/detail?id=31833">crbug/31883</a>, <a href="http://code.google.com/p/chromium/issues/detail?id=35739">crbug/35739</a>, <a href="https://bugs.webkit.org/show_bug.cgi?id=34147">webk.it/34147</a>)</small></li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">      <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
      <span style="color: #000000; font-weight: bold;">font-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
      <span style="color: #000000; font-weight: bold;">font-variant</span><span style="color: #00AA00;">:</span><span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
      <span style="color: #808080; font-style: italic;">/* these values are defaults in FF/Opera/IE but not webkit */</span></pre></div></div>

<ul>
<li>FF/Linux cannot serve webfonts from the file:// protocol. (Also, <a href="http://neugierig.org/software/chromium/fonts/">a tome</a> on type quality with linux from Evan Martin)</li>
<li>TrueType format renders with a better quality than Opentype CFF. (<a href="http://typophile.com/node/69902#comment-408978">sez Typekit</a>) (<a href="http://www.fontsquirrel.com/fontface/generator">fontsquirrel default</a>)</li>
<li>In IE6-8, using <code>createStyleSheet</code> and then setting <code>styleElem.styleSheet.cssText</code> to a text value that includes a @font-face declaration going into will crash IE6-8. (<a href="http://www.phpied.com/dynamic-script-and-style-elements-in-ie/#comment-72460">src</a>)</li>
<li><code><a href="https://developer.mozilla.org/en/CSS:font-size-adjust">font-size-adjust</a></code> (only supported in Firefox) normalizes x-height and may improve the <a href="http://paulirish.com/2009/fighting-the-font-face-fout/">FOUT</a>.</li>
<li><code>text-transform</code> doesn&#039;t play well with @font-face in current implementations. (<a href="http://snook.ca/archives/design/minimal#c63884" title="The reason for text-transform:uppercase is actually a technical one. Both Opera and Internet Explorer don't use the uppercase letters from the subsetted font ">via snook</a> &amp; Gary Jones)</li>
<li>@font-face doesnt play nice with css transitions. (<a href="http://unstoppablerobotninja.com/entry/webkit-bug-yay/">via ethan marcotte</a>)</li>
<li>IE6 under High Security settings will pop a security dialog when a site tries to use @font-face. (via <a href="http://paulirish.com/2010/font-face-gotchas/#comment-32337">Wouter Bos</a>)</li>
<li>There have been reports that when a font is <a href="http://www.twardoch.com/webfonts/embeddedsubsets/">segmented into multiple files</a>, a css <code>text-shadow</code> can overlap in a weird way. <small>(pics plz? :)</small>
<li>Aaron James Young dug into @font-face on <a href="http://www.aaronjamesyoung.com/blog/personal/font-face-for-obscure-linux-browsers">obscure linux-only browsers</a>.
<li>If a @font-face declaration is within a media query <code>@media screen { ...</code>, it will fail in Firefox. <small>(Thx Ben Kulbertis) <a href="http://bugzil.la/567573">http://bugzil.la/567573</a></small>
<li>Hosting the fonts on a different domain? Firefox requires some extra effort; you&#039;ll need to add the <code>Access-Control-Allow-Origin</code> header, whitelisting the domain you&#039;re pulling the asset from. <a href="http://github.com/paulirish/frontend-pro-template/blob/4092e6cbe6249c188781b8a2979f1760ae4ec181/.htaccess#L11">Example .htaccess config here</a>. Alternatively, you can use the base64 encoding in CSS (create it with the fontsquirrel <a href="http://www.fontsquirrel.com/fontface/generator">generator</a>) to avoid setting headers. <a href="http://geoff.evason.name/2010/05/03/cross-domain-workaround-for-font-face-and-firefox/">details here</a>
<li><b>SVG Fonts </b>- Currently SVG is the only way to get webfonts working on iPhone and iPad. It is the most rudimentary format for fonts on the web.</b>
<ul>
<li>SVG Fonts lack kerning and other complementary information
<li> SVGz is a format that bakes compression right in and will save you bandwidth overhead. But you&#039;ll need to add this to to your .htaccess for this benefit. <code>AddType image/svg+xml svg svgz AddEncoding gzip svgz</code> <small>(via <a href="http://twitter.com/FontSquirrel/status/14855840545">@fontsquirrel</a>)</small>
<li>SVG fonts don&#039;t work with a cache manifest. Due to the manifest treating # as comments and Mobile Safari requiring the font ID reference in the URL. [Unverified] <small>(via <a href="http://paulirish.com/2010/font-face-gotchas/#comment-33684">Tristan Dunn</a>)</small>
<li>Using <code>text-overflow: ellipsis;</code> turned the contents into only &#034;&#8230;&#034; and nothing else. <small>(via <a href="http://paulirish.com/2010/font-face-gotchas/#comment-33684">Tristan Dunn</a>)</small>
<li>Letter-spacing css doesnt appear to work with SVG fonts.
</ul>
<li><a href="http://paulirish.com/wp-content/uploads/2010/05/mime-types.png"><img src="http://paulirish.com/wp-content/uploads/2010/05/mime-types.png" alt="" height="100" align="right" /></a>IIS Needs some custom mimetype configuration for serving webfonts. To enable, go to: Default Web Site > Properties > HTTP Headers > File Types > New Type&#8230;
<ul>
<li>.otf : <code>font/otf</code></li>
<li>.svg : <code>image/svg+xml</code></li>
</ul>
<p>(<a href="http://twitter.com/ProtectedVoid/statuses/8042733261">thx ProtectedVoid</a> &amp; Tom Nelson) — <a href="http://sandbox.sekforde.co.uk/@Font-Face/">Test page</a>
</li>
</ul>
<h4>@font-face links that might have sneaked past you</h4>
<ul>
<li><a href="http://www.w3.org/International/tests/tests-html-css/list-fonts">@font-face internationalization tests</a> from the W3C</li>
<li>Kernest open-sourced <a href="http://fontue.com/">its font server, Fontue</a></li>
<li>Bert Bos gave the <a href="http://www.w3.org/Talks/2010/0313-Fonts-SXSW/">full history of webfonts</a> at SXSW</li>
</ul>
<h4 id="smiley">And.. regarding @font-face syntax</h4>
<p><strong>I now recommend the <a href="http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/#smiley">bulletproof smiley variation</a> over the original bulletproof syntax</strong>.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@font-face {</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">'Graublau Web'</span><span style="color: #00AA00;">;</span>
  src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'GraublauWeb.eot'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
  src<span style="color: #00AA00;">:</span> local<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'?'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span>
         <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'GraublauWeb.woff'</span><span style="color: #00AA00;">&#41;</span> format<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'woff'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'GraublauWeb.ttf'</span><span style="color: #00AA00;">&#41;</span> format<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'truetype'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>From the <a href="http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/#smiley">bulletproof post</a>:</p>
<blockquote><p>Yes, it&#039;s a smiley face. The <a href="http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html#9.e">OpenType spec</a> indicates any two-byte unicode characters won&#039;t work in a font name on Mac at all, so that lessens the likelihood that someone actually released a font with such a name.</p></blockquote>
<p>There are a few reasons why smiley is a better solution:</p>
<ul>
<li>Webkit+Font Management software can mess up local references, like <a href="http://snook.ca/archives/html_and_css/font-face-in-chrome">turning glyphs into A blocks</a>.  (<a href="http://code.google.com/p/chromium/issues/detail?id=33173">crbug.com/33173</a>)</li>
<li>On OS X, Font Management software may alter system settings to show a dialog when trying to access a local() font that&#039;s accessible outside of Library/Fonts. <a href="http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/#fontexplorerfail">More detail </a>on my bulletproof post. (<a href="http://code.google.com/p/chromium/issues/detail?id=29729">crbug.com/29729</a>) Font Explorer X is also known to mess up other stuff in Firefox: <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=531771">bugzil.la/531771</a></li>
<li>Although it&#039;s unlikely, you could reference a local() font which is completely different than what you think it is. (<a href="http://www.typophile.com/node/63992">Typophile post on different fonts, same name</a>) At the very least its a risk, and you&#039;re ceding control of the type to both the browser and host machine. This risk may not be worth the benefit of avoiding the font download.</li>
</ul>
<p>These are all pretty edge case issues, but it&#039;s worth considering. <a href="http://www.fontsquirrel.com/">FontSquirrel</a> has already made the smiley syntax the new default in the <a href="http://www.fontsquirrel.com/fontface/generator">Generator</a>, and you should use it going forward as well.</p>
<div class="update">2010.05.10: Added IE6 security issue from Wouter.</p>
<p>2010.05.13: Added segmented font/text-shadow issue. </p>
<p>2010.05.17: Link to linux @font-face research</p>
<p>2010.05.22: Media Queries firefox failure added.</p>
<p>2010.05.29: Cross-domain tricks added. SVGz trick added</p>
<p>2010.07.06: Added a bunch around SVG fonts</p></div>
<div class="readmore">Take a look at some of my other <small>(recently updated)</small> webfont stuff:</p>
<ul>
<li><a href="http://paulirish.com/2009/fighting-the-font-face-fout/">Fighting the @font-face FOUT</a></li>
<li><a href="http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/">Bulletproof @font-face syntax</a></li>
<li><a href="http://paulirish.com/2009/squeeze/">Web Typography Presentations</a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://paulirish.com/2010/font-face-gotchas/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Bug tracker short urls</title>
		<link>http://paulirish.com/2010/bug-tracker-short-urls/</link>
		<comments>http://paulirish.com/2010/bug-tracker-short-urls/#comments</comments>
		<pubDate>Tue, 04 May 2010 15:04:26 +0000</pubDate>
		<dc:creator>Paul Irish</dc:creator>
		
		<category><![CDATA[front-end development]]></category>

		<guid isPermaLink="false">http://paulirish.com/?p=706</guid>
		<description><![CDATA[I&#039;ve found myself filing and watching tickets on browser bug trackers a lot more lately.
Turns out, they have some handy shorturls which make for easy linking to tickets.
http://webk.it/19264 for webkit
http://bugzil.la/475606 for firefox/mozilla
http://crbug.com/11359 for google chrome
http://crosbug.com/59 for google&#039;s chrome os
In fact, the webk.it URLs are debuting today! I luckily convinced Wolfango Chiappella of Wolfango&#039;Studio (who owns [...]]]></description>
			<content:encoded><![CDATA[<p>I&#039;ve found myself filing and watching tickets on browser bug trackers a lot more lately.</p>
<p>Turns out, they have some handy shorturls which make for easy linking to tickets.</p>
<p><a href="http://webk.it/19264">http://<strong>webk.it</strong>/19264</a> <small>for webkit</small><br />
<a href="http://bugzil.la/475606">http://<strong>bugzil.la</strong>/475606</a> <small>for firefox/mozilla</small><br />
<a href="http://crbug.com/11359">http://<strong>crbug.com</strong>/11359</a> <small>for google chrome</small><br />
<a href="http://crosbug.com/59">http://<strong>crosbug.com</strong>/59</a> <small>for google&#039;s chrome os</small></p>
<p>In fact, <strong>the webk.it URLs are debuting today</strong>! I luckily convinced Wolfango Chiappella of <a href="http://wolfangostudio.com/">Wolfango&#039;Studio</a> (who owns the domain) to set up a redirect. Grazie di cuore!</p>
<div class="update">2010.07.22: Mihai of the google reader team added a nice new one for chromium changesets: <a href="http://crrev.com/41850">http://crrev.com/41850</a><br />
Mozilla also has a mysterious URL shortener for all of their MDC docs and such, but I don&#039;t know how it works other than bit.ly using it automatically. *magic!*
</div>
<p><!--<br />
http://webkit.org/quality/reduction.html<br />
&lt;link rev="canonical" type="text/html" href="http://flic.kr/p/7JSACg" &gt;</p>
<p>http://sites.google.com/a/snaplog.com/wiki/short_url</p>
<p>http://blog.whatwg.org/the-road-to-html-5-link-relations/comment-page-1#comment-40631<br />
--></p>
]]></content:encoded>
			<wfw:commentRss>http://paulirish.com/2010/bug-tracker-short-urls/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Goin' GOOG</title>
		<link>http://paulirish.com/2010/going-goog/</link>
		<comments>http://paulirish.com/2010/going-goog/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 15:01:07 +0000</pubDate>
		<dc:creator>Paul Irish</dc:creator>
		
		<category><![CDATA[me]]></category>

		<guid isPermaLink="false">http://paulirish.com/?p=697</guid>
		<description><![CDATA[Big news! (for me, at least) I&#039;m taking a position on the Chrome team doing Developer Relations. I&#039;ll be evangelizing HTML5, Chrome, Chrome OS, and everything under the Open Web umbrella. It&#039;ll be a bunch of writing, speaking, tutorials and guides, and  engagement with the developer community. (Hey guys! :)
As I&#039;m very passionate about [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://paulirish.com/wp-content/uploads/2010/04/google-chrome-logo-711569-150x150.jpg"   align="right">Big news! <small>(for me, at least)</small> I&#039;m taking a position on the <strong>Chrome team</strong> doing <strong>Developer Relations</strong>. I&#039;ll be evangelizing <ins>HTML5, Chrome, Chrome OS, and everything under the Open Web umbrella</ins>. It&#039;ll be a bunch of writing, speaking, tutorials and guides, and  engagement with the developer community. <small>(Hey guys! :)</small></p>
<p>As I&#039;m very passionate about all this, I&#039;m quite excited about this opportunity. Google Chrome has become the browser to beat very quickly. It&#039;s a solid platform for browsing and developing as well. I can&#039;t wait to join the team and start kicking ass, making Chrome ideal for developers and pushing the open web forward. </p>
<p>As part of this, I&#039;m also moving to San Francisco. Farewell, my dear Boston. *sniff* :(</p>
<p>I&#039;m leaving an incredible team of UX architects, interactive designers, software engineers, and front-end developers at <a href="http://molecular.com/">Molecular</a>/<a href="http://www.isobar.net/">Isobar</a>. It&#039;s been 3.5 years and I would&#039;ve easily stayed longer. If you&#039;re in Boston, Toronto or SF and want to develop incredible sites and apps for high-profile clients, I couldn&#039;t recommend working there enough. <tt><3z</tt></p>
<p>This is all happening over the next 60 days, along with a busy schedule of <a href="http://jsconf.us/2010/">JSConf</a>, <a href="http://events.jquery.org/2010/sf-bay-area/">Bay Area jQuery Conference</a>, <a href="http://texasjavascript.com/">TXJS</a>, and a few weddings. </p>
<p>I plan to continue to be active in the jQuery community <small>(thx to my compadre <a href="http://www.learningjquery.com/">Karl Swedberg</a> for the referral!)</small>, and continue developing <a href="http://www.modernizr.com">Modernizr</a> and <a href="http://css3please.com">CSS3Please</a>. I also got a few more projects on the way. Exciting times. :)</p>
]]></content:encoded>
			<wfw:commentRss>http://paulirish.com/2010/going-goog/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SVG Filters on HTML5 video</title>
		<link>http://paulirish.com/2010/svg-filters-on-html5-video/</link>
		<comments>http://paulirish.com/2010/svg-filters-on-html5-video/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 04:24:14 +0000</pubDate>
		<dc:creator>Paul Irish</dc:creator>
		
		<category><![CDATA[front-end development]]></category>

		<guid isPermaLink="false">http://paulirish.com/?p=681</guid>
		<description><![CDATA[This weekend I hung out with some SVG all-stars and learned how SVG, HTML, and CSS can combine for some badass visual filters applied to content. Clearly it&#039;s the most fun to apply it to &#60;video>, though I could have done it to any HTML.  Peep the video:

Demo page: SVG filters on html5 &#60;video> [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend I hung out with some SVG all-stars and learned how SVG, HTML, and CSS can combine for some badass visual filters applied to content. Clearly it&#039;s the most fun to apply it to &lt;video>, though I could have done it to any HTML.  Peep the video:<br />
<object width="600" height="700"><param name="movie" value="http://paulirish.com/work/octopussy.swf"></param><embed src="http://paulirish.com/work/octopussy.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="600" height="700"></embed></object></p>
<p><a href="http://paulirish.com/work/videooo.xhtml">Demo page: SVG filters on html5 &lt;video></a> (requires a <a href="http://nightly.mozilla.org/">Firefox nightly</a>)</p>
<p>Blur is certainly the most useful, I&#039;d say. For instance, <a href="http://mikematas.com/">Mike Matas&#039;s new site</a> could dynamically blur the images instead of manually cutting <a href="http://www.mikematas.com/albums/Photos/small/Blue_Eyes.jpg">blurred jpgs</a>. </p>
<p>Leave a comment if you can think of other use cases for filters like these on your HTML content.</p>
]]></content:encoded>
			<wfw:commentRss>http://paulirish.com/2010/svg-filters-on-html5-video/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Introducing… CSS3Please.com</title>
		<link>http://paulirish.com/2010/introducing-css3please/</link>
		<comments>http://paulirish.com/2010/introducing-css3please/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 15:54:42 +0000</pubDate>
		<dc:creator>Paul Irish</dc:creator>
		
		<category><![CDATA[front-end development]]></category>

		<guid isPermaLink="false">http://paulirish.com/?p=656</guid>
		<description><![CDATA[
Man, whenever I&#039;m writing some css3, I get so tired of writing all the vendor-specific prefixes (like -moz-border-radius). Combo that with remembering who supports what and I wantedneeded a shortcut.
Today, I&#039;m happy to release v1.0 of css3please.com: a cross-browser css3 rule generator, produced by Jonathan Neal and myself. In addition to syncing and normalizing changes [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://css3please.com"><img src="http://paulirish.com/wp-content/uploads/2010/03/css3pleasess.png" style="border: 1px solid #eee; padding: 10px"></a></p>
<p>Man, whenever I&#039;m writing some css3, I get so tired of writing all the vendor-specific prefixes (like <em>-moz-</em>border-radius). Combo that with remembering who supports what and I <del>wanted</del><ins>needed</ins> a shortcut.</p>
<p>Today, I&#039;m happy to release v1.0 of<strong> <a href="http://css3please.com/">css3please.com: a cross-browser css3 rule generator</a></strong>, produced by <a href="http://twitter.com/jon_neal">Jonathan Neal</a> and myself. In addition to <strong>syncing and normalizing changes</strong> across the necessary properties, it also sneaks in <strong>IE support</strong> for a few features via IE filters. Right now it helps you write the rules for: border-radius, box-shadow, linear-gradients, rotation and @font-face. A few more transforms like skew and scale are on their way, stay tuned.</p>
<p>Shouts to all the good people doing research and making tools in the css3 arena: <a href="http://westciv.com/tools/gradients/">John Allsopp</a>, <a href="http://css-tricks.com/">Chris Coyier</a>, <a href="http://www.phpied.com/css-performance-ui-with-fewer-images/">Stoyan Stefanov</a>, <a href="http://gradients.glrzad.com/">Damian Galarza</a>, <a href="http://www.thecssninja.com/">Ryan Seddon</a>, <a href="http://border-radius.com/">border-radius.com</a>.</p>
<p>Please leave comments and feedback below.</p>
<div class="update">2010.04.06 - Today I pushed a big update. Mousewheel support is much better and the clipboard interaction sucks a lot less. We now have 360° IE rotation support thanks to <a href="http://www.useragentman.com/blog/" rel="nofollow">Zoltan</a> as well as css transitions support. I also fixed a number of small bugs that were reported. </p>
<p>Based on the popularity of this tool, I&#039;ll definitely keep working on it; making it better for ya&#039;ll. If you would like to contribute, please contact me.</p>
<p><a href="http://pc.de/pages/introducing-css3please-be">Chytac pa-belarusku</a> (belorussian translation)</div>
]]></content:encoded>
			<wfw:commentRss>http://paulirish.com/2010/introducing-css3please/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Front-end development feeds to follow</title>
		<link>http://paulirish.com/2010/front-end-development-feeds-to-follow/</link>
		<comments>http://paulirish.com/2010/front-end-development-feeds-to-follow/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 22:54:14 +0000</pubDate>
		<dc:creator>Paul Irish</dc:creator>
		
		<category><![CDATA[front-end development]]></category>

		<guid isPermaLink="false">http://paulirish.com/?p=647</guid>
		<description><![CDATA[If you&#039;re running low on front-end oriented stuff to read, I&#039;ve got 130 exactly 200 feeds of high quality for ya.

I&#039;ve republished this as a google reader bundle, for easy subscribing. 
If you use another feed reader, you can import them via the OPML file: frontendfeeds.xml
2010.07.07: Updated to google reader bundle. added 70+ feeds
]]></description>
			<content:encoded><![CDATA[<p>If you&#039;re running low on front-end oriented stuff to read, I&#039;ve got <del>130</del> <ins>exactly 200</ins> feeds of high quality for ya.</p>
<p><a href="http://www.google.com/reader/bundle/user/11165870484951445324/bundle/frontend"><img alt="google reader bundle" src="http://paulirish.com/wp-content/uploads/2010/03/frontendbundle.png"></a></p>
<p>I&#039;ve republished this as a <a href="http://www.google.com/reader/bundle/user/11165870484951445324/bundle/frontend">google reader bundle</a>, for easy subscribing. </p>
<p>If you use another feed reader, you can import them via the <a href="http://en.wikipedia.org/wiki/OPML">OPML</a> file: <a href="http://www.google.com/reader/public/subscriptions/user%2F11165870484951445324%2Fbundle%2Ffrontend">frontendfeeds.xml</a></p>
<div class="update">2010.07.07: Updated to google reader bundle. added 70+ feeds</div>
]]></content:encoded>
			<wfw:commentRss>http://paulirish.com/2010/front-end-development-feeds-to-follow/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to fulfill your own feature request -or- Duck Punching with jQuery!</title>
		<link>http://paulirish.com/2010/duck-punching-with-jquery/</link>
		<comments>http://paulirish.com/2010/duck-punching-with-jquery/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 18:27:50 +0000</pubDate>
		<dc:creator>Paul Irish</dc:creator>
		
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://paulirish.com/?p=629</guid>
		<description><![CDATA[Wait, what? Well first, duck punching is another name for monkey patching. Monkey Patching is a technique to &#034;extend or modify the runtime code of dynamic languages without altering the original source code.&#034; But then some Ruby hackers decided that since we rely on duck typing so often, a more proper name was in order:
&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>Wait, what? Well first, duck punching is another name for monkey patching. <a href="http://en.wikipedia.org/wiki/Monkey_patch">Monkey Patching</a> is a technique to &#034;extend or modify the runtime code of dynamic languages without altering the original source code.&#034; But then some Ruby hackers decided that since we rely on <a href="http://en.wikipedia.org/wiki/Duck_typing">duck typing</a> so often, a more proper name was in order:</p>
<blockquote style="clear:right"><p>&#8230; if it walks like a duck and talks like a duck, it’s a duck, right? So if this duck is not giving you the noise that you want, <b>you’ve got to just punch that duck until it returns what you expect</b>.<sup><a href="http://podcast.rubyonrails.org/programs/1/episodes/railsconf-2007">[1]</a></sup></p></blockquote>
<p><img src="http://paulirish.com/wp-content/uploads/2010/02/duckpunch.jpg" height="214" style="border: 1px solid #eee; padding: 10px; margin: 10px "><br />
In jQuery we can use this to great effect. We&#039;ll employ an AOP-like approach (<a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming">aspect-oriented programming</a>), maintaining the original function but wrapping it with our enhancement.</p>
<h4>Example 1: Adding color support</h4>
<p>(This is a silly example, but hopefully it explains the idea. )<br />
You&#039;re fully aware that you can use certain <A href="http://en.wikipedia.org/wiki/X11_color_names">color names</a> in HTML. But sadly, everyone&#039;s favorite Crayola&trade; color, Burnt Sienna, can&#039;t play along. Well, not until now&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">var</span> _oldcss <span style="color: #339933;">=</span> $.<span style="color: #660066;">fn</span>.<span style="color: #660066;">css</span><span style="color: #339933;">;</span>
&nbsp;
    $.<span style="color: #660066;">fn</span>.<span style="color: #660066;">css</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>prop<span style="color: #339933;">,</span>value<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^background-?color$/i</span>.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span>prop<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> value.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #3366CC;">'burnt sienna'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
           <span style="color: #000066; font-weight: bold;">return</span> _oldcss.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span>prop<span style="color: #339933;">,</span><span style="color: #3366CC;">'#EA7E5D'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
           <span style="color: #000066; font-weight: bold;">return</span> _oldcss.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span>arguments<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// and using it...</span>
jQuery<span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">body</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'backgroundColor'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'burnt sienna'</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>Let&#039;s walk through that a little bit slower, shall we? </p>
<p>First we start off with a self-executing anonymous function that makes a happy closure while remapping jQuery to $:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// ...</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now we save a reference to the old css method as a local variable, and set up our new definition for that method:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">    <span style="color: #003366; font-weight: bold;">var</span> _oldcss <span style="color: #339933;">=</span> $.<span style="color: #660066;">fn</span>.<span style="color: #660066;">css</span><span style="color: #339933;">;</span>
&nbsp;
    $.<span style="color: #660066;">fn</span>.<span style="color: #660066;">css</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>prop<span style="color: #339933;">,</span>value<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">// ....</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Inside our function definition we have an if statement that breaks up two code paths, the new enhanced route, and the old default:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">        <span style="color: #006600; font-style: italic;">// if the user passed in backgroundColor and 'burnt sienna'</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^background-?color$/i</span>.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span>prop<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> value.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #3366CC;">'burnt sienna'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">// call the old css() method with this hardcoded color value</span>
            <span style="color: #000066; font-weight: bold;">return</span> _oldcss.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span>prop<span style="color: #339933;">,</span><span style="color: #3366CC;">'#EA7E5D'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #006600; font-style: italic;">// otherwise call the old guy normally, taking his return value and passing it on.</span>
            <span style="color: #000066; font-weight: bold;">return</span> _oldcss.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span>arguments<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Scroll back up to see the whole thing together. Can you dig it?</p>
<h4>Example 2: $.unique() enhancement</h4>
<p>$.unique only winnows an array of DOM elements to contain no duplicates, but what if you want all non-duplicates of any type? Here&#039;s an upgrade:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">var</span> _old <span style="color: #339933;">=</span> $.<span style="color: #660066;">unique</span><span style="color: #339933;">;</span>
&nbsp;
    $.<span style="color: #660066;">unique</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>arr<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #006600; font-style: italic;">// do the default behavior only if we got an array of elements</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!!</span>arr<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">nodeType</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">return</span> _old.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span>arguments<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #006600; font-style: italic;">// reduce the array to contain no dupes via grep/inArray</span>
            <span style="color: #000066; font-weight: bold;">return</span> $.<span style="color: #660066;">grep</span><span style="color: #009900;">&#40;</span>arr<span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>v<span style="color: #339933;">,</span>k<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">return</span> $.<span style="color: #660066;">inArray</span><span style="color: #009900;">&#40;</span>v<span style="color: #339933;">,</span>arr<span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> k<span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// in use..</span>
<span style="color: #003366; font-weight: bold;">var</span> arr <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'first'</span><span style="color: #339933;">,</span><span style="color: #CC0000;">7</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span><span style="color: #CC0000;">7</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'last'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'last'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
$.<span style="color: #660066;">unique</span><span style="color: #009900;">&#40;</span>arr<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// [&quot;first&quot;, 7, true, 2, &quot;last&quot;]</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> arr <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span><span style="color: #CC0000;">3</span><span style="color: #339933;">,</span><span style="color: #CC0000;">4</span><span style="color: #339933;">,</span><span style="color: #CC0000;">5</span><span style="color: #339933;">,</span><span style="color: #CC0000;">4</span><span style="color: #339933;">,</span><span style="color: #CC0000;">3</span><span style="color: #339933;">,</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
$.<span style="color: #660066;">unique</span><span style="color: #009900;">&#40;</span>arr<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// [1, 2, 3, 4, 5]</span></pre></div></div>

<h4>A Duck Punching Pattern</h4>
<p>Here&#039;s the bare pattern. Feel free to use this as the basis of your own:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// store original reference to the method</span>
    <span style="color: #003366; font-weight: bold;">var</span> _old <span style="color: #339933;">=</span> $.<span style="color: #660066;">fn</span>.<span style="color: #660066;">method</span><span style="color: #339933;">;</span>
&nbsp;
    $.<span style="color: #660066;">fn</span>.<span style="color: #660066;">method</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>arg1<span style="color: #339933;">,</span>arg2<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> ... <span style="color: #660066;">condition</span> ... <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
           <span style="color: #000066; font-weight: bold;">return</span>  .... 
        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>           <span style="color: #006600; font-style: italic;">// do the default</span>
           <span style="color: #000066; font-weight: bold;">return</span> _old.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span>arguments<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h4>What else could I use this for?</h4>
<p>Some other uses I&#039;ve had or seen for this sort of thing:</p>
<ul>
<li><a href="http://pastie.org/701232">throwing an exception when $.fn.find returns a 0-length object</a></li>
<li><a href="http://github.com/paulirish/jQuery-miniplugins/blob/master/cssmonkeypatch.js">returning the shorthand value when asking for $(elem).css(&#039;margin&#039;)</a></li>
<li><a href="http://ralphholzmann.com/2010/01/fadein_and_jquery-goodness/">removing IE&#039;s filter attribute after a fade</a></li>
<li><a href="http://github.com/ralphholzmann/jquery-goodness/blob/master/monkey-patches.js">next(2) goes to the subsequent adjacent node</a></li>
<li><a href="http://github.com/jamespadolsey/jQuery-plus">&#8230; and James Padolsey&#039;s jQuery-Plus has a bunch of more these</a></li>
</ul>
<p>So while you&#039;re free to file a feature request of jQuery, most of the time you can actually enhance jQuery&#039;s methods yourself! Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://paulirish.com/2010/duck-punching-with-jquery/feed/</wfw:commentRss>
		</item>
		<item>
		<title>On jQuery's live()</title>
		<link>http://paulirish.com/2010/on-jquery-live/</link>
		<comments>http://paulirish.com/2010/on-jquery-live/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 17:59:57 +0000</pubDate>
		<dc:creator>Paul Irish</dc:creator>
		
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://paulirish.com/?p=572</guid>
		<description><![CDATA[Since the release of 1.4, there&#039;s been a lot of discussion about live(). Now that it&#039;s almost as fully featured as bind(), it&#039;s getting quite a workout.
One of the larger calls to action is to introduce $.live(selector,eventType,handler). There are two primary reasons I&#039;ve seen behind this proposal:

There is a performance hit for the initial selection [...]]]></description>
			<content:encoded><![CDATA[<p>Since the <a href="http://jquery14.com/day-01/jquery-14">release of 1.4</a>, there&#039;s been a lot of discussion about <code>live()</code>. Now that it&#039;s almost as fully featured as <code>bind()</code>, it&#039;s getting quite a workout.</p>
<p>One of the larger calls to action is to introduce <code>$.live(selector,eventType,handler)</code>. There are two primary reasons I&#039;ve seen behind this proposal:</p>
<ol>
<li>There is a performance hit for the initial selection in <code>$('a.whatever').live(</code>.. that isn&#039;t neccessary</li>
<li><code>live()</code> cannot work on any arbitrary collection of DOM elements in jQuery object, as a side effect of a very different internal operation, thus providing an inconsistent developer experience than all other $.fn.foo methods.</li>
</ol>
<h4>$.live for performance</h4>
<p>Sizzle is used to find any matching elements before the live method discards them an only uses the jQobj.selector property and context. It&#039;s a waste, I agree. But you can avoid it. <a href="http://www.zachleat.com/web/2009/05/08/performance-caveat-with-jquery-selectors-and-live-events/">Zachleat posted this technique</a> first. Then I stole a code snippet from <a href="http://twitter.com/janl">@janl</a> to show off in my <a href="http://paulirish.com/perf" title="slide 35">jQuery Performance talk</a> for jQCon. This inspired <a href="http://github.com/furf/jquery-live">furf&#039;s jQuery.live()</a> patch. And now <a href="http://forum.jquery.com/topic/jquery-live-jquery-fn-live-discussion">jmar777 has resurrected</a> that discussion. </p>
<p><strong>I do not think the performance gain in <code>$.live</code> is worth adding it to jQuery core</strong>, by any means. Let&#039;s take an example.</p>
<blockquote style="background-image:none"><p>
Let&#039;s say we&#039;re dealing with <code>$(selector).live('click',fn)</code></p>
<p>On every click on the page, the event is caught at the context.. the <code>document</code>. But <code>evt.target</code> points to the top-most element that was clicked on.<br />
jQuery then traverses from evt.target through each ancestor of that node all the way up to document checking <code>if (jQuery(elem).is(selector))</code>.<sup>[<a href="http://gist.github.com/277432#LID3632">source</a>]</sup></p>
<p>I think a reasonable estimated depth of evt.targets is like 8 (From the document to HTML element to BODY and so on.. a depth of 20 is not uncommon by any means). And lets say we have an average 5 clicks on a page.<br />
That&#039;s 40 total checks against the <code>selector</code> (plus the original one done at bind time).<br />
So in my opinion a 1/41 speed gain isn&#039;t worth changing the API.
</p></blockquote>
<p>Scoping the delegation a context, however has a much larger impact on performance: <code>$(selector,elem).live('click',fn)</code> Here, only clicks within the context are caught, so not only is the parent traversal depth much more shallow, but that entire sequence is avoided for all events occurring outside that area. </p>
<p>The current API to take advantage of this optimization requires code like <code>$('a.awesome', $('#box')[0]).live(&#8230;</code> Yuck! So I <a href="http://github.com/paulirish/jquery/commit/3a5d3a9a922b9c53866931a449abd3d9c79e537d">wrote a patch to deliver this same optimization</a> to any ID-rooted selectors. (The perk being that everyone who learns #id-rooted selectors are fast for selecting get a related perf boost here). But as Justin Meyer pointed out in the comments, it&#039;s not as flexible as live() currently is.</p>
<h4>$.fn.live cannot operate on any jQuery-wrapped collection of elements</h4>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a.foo'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">filter</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.bar'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">live</span><span style="color: #009900;">&#40;</span>... <span style="color: #006600; font-style: italic;">// fails</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a.link'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">nextAll</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">live</span><span style="color: #009900;">&#40;</span>... <span style="color: #006600; font-style: italic;">// fails</span>
$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">live</span><span style="color: #009900;">&#40;</span>... <span style="color: #006600; font-style: italic;">// fails</span></pre></div></div>

<p>Quite simply, <code>$.fn.live</code> needs to be at the top of a chain to guarantee the <code>.selector</code> and <code>.context</code> properties of the jQuery object represent that set. Unlike other $.fn methods, live utilizes those properties and <i>not</i> the actual collection of elements that result from selection, traversing, and filtering.</p>
<h4>$.live() and let $.die()</h4>
<p>What are the possible solutions?</p>
<ol>
<li><b>Turn on a dirty flag in traversal methods</b>, so if you try and live() that collection, it will throw an error.</li>
<li><strong>Deprecate $.fn.live and use $.live(selector[,context],type,handler)</strong></li>
<li><strong>Use $.live to create a &#034;live jQuery object&#034;</strong> that defaults to live-bindings: <code>$.live(selector,context).click(fn).mouseenter(fn).unbind("click")</code> <sup>[<a href="http://pastie.org/790043">source</a>]</sup></li>
<li><b>Change $.fn.live to operate from a context:</b> <code>$(context).live('selector', event, fn)</code> This bakes the performance benefit from above right in.</li>
</ol>
<p>Any others? What do you guys think? Is there a solution that preserves backwards-compatibility while solving the issue?</p>
<p><small>btw- thx to jmar777, yehuda katz, ben alman, ajpiano, brandon aaron and julian aubourg for their great thoughts on the issue.</small></p>
<div class="update">The people in this discussion got together and hashed out what would make sense. John Resig then <a href="http://github.com/jquery/jquery/commit/31432e048f879b93ffa44c39d6f5989ab2620bd8">landed a new delegate/undelegate API</a>. It&#039;s good. :)</div>
]]></content:encoded>
			<wfw:commentRss>http://paulirish.com/2010/on-jquery-live/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Updates from all around - Dec 2009</title>
		<link>http://paulirish.com/2009/updates-from-all-around-dec-2009/</link>
		<comments>http://paulirish.com/2009/updates-from-all-around-dec-2009/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 22:04:28 +0000</pubDate>
		<dc:creator>Paul Irish</dc:creator>
		
		<category><![CDATA[javascript]]></category>

		<category><![CDATA[jquery]]></category>

		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://paulirish.com/?p=559</guid>
		<description><![CDATA[A lot of the work I&#039;m doing doesn&#039;t turn into new posts so here&#039;s a summary of what&#039;s been going on:
yayQuery
Since it was announced here, we&#039;ve come a long way. We just put out our 7th episode (now in HD!). The show format has tightened up and we&#039;re putting a lot of time into making [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of the work I&#039;m doing doesn&#039;t turn into new posts so here&#039;s a summary of what&#039;s been going on:</p>
<h4>yayQuery</h4>
<p><a href="http://yayquery.com"><img align="right" src="http://paulirish.com/wp-content/uploads/2009/12/yayquerylogo.png"></a>Since it was announced here, we&#039;ve come a long way. We just put out <a href="http://yayquery.com" title="view source for funtimes, too">our 7th episode</a> (now in HD!). The show format has tightened up and we&#039;re putting a lot of time into making it even better. <a href="http://twitter.com/yayQuery">Follow us on twitter</a> or subscribe to catch all the goodness. We also put out an entire episode devoted to what&#039;s coming in jQuery 1.4 (aka 1.MOAR), so peep it if you&#039;re curious.</p>
<h5>jQuery Singalong plugin</h5>
<p>I was a finalist at Boston&#039;s <a href="http://musichackdayboston.pbworks.com/">Music Hack Day</a> with the <a href="http://yayquery.github.com/jquery-singalong/">jQuery Singalong plugin</a>. It essentially allows you to add timed annotations to the HTML5 audio and video elements. (Also it was the first time I legitimately used javascript&#039;s <code>Infinity</code> :) In addition, I put out the <small>(very!)</small> alpha jQuery Bouncing Ball plugin. Check out <a href="http://yayquery.github.com/jquery-singalong/">the demos to get a taste</a> </p>
<h4>Modernizr updates</h4>
<p><a href="http://www.modernizr.com"><img align="left" src="http://paulirish.com/wp-content/uploads/2009/12/logo.png"></a>Faruk and I pushed out <a href="http://www.modernizr.com/releases/">Modernizr 1.1</a>, which can now detect what audio/video formats your browser supports, all sorts of HTML5 forms goodness, and some other ones like localStorage and applicationCache. We&#039;re delighted to be part of Mark Pilgrim&#039;s <a href="http://diveintohtml5.org/detect.html">Dive into HTML5 book</a> and pumped to help push the edge of progressive enhancement.</p>
<h4>@font-face and webfonts</h4>
<p>It&#039;s a rapidly changing landscape, so I&#039;ve been keeping all my <a title="category/typography" href="http://paulirish.com/category/typography/">font-y posts</a> up to date:</p>
<ul>
<li><a href="http://paulirish.com/2009/fighting-the-font-face-fout/">Fighting the @font-face FOUT</a> now has a <i>Defeat the FOUT entirely</i> script and detail on when FOUT occurs</li>
<li><a href="http://paulirish.com/2009/chrome-and-font-face-a-summary/#update/">Chrome and @font-face</a> now represents the latest status and info.</li>
<li><a href="http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/">Bulletproof @font-face syntax</a> now features detail and helpful links when it comes to SVG/WOFF along with the latest gotcha&#039;s.</li>
</ul>
<h5>@font-face feature detection</h5>
<p>I&#039;ve updated the <a href="http://paulirish.com/2009/font-face-feature-detection/">existing feature detection script</a> to use a smaller file. (Thanks to the <a href="http://fontsquirrel.com">Font Squirrel</a> for the help). You would use this script to detect if support is present or not; perhaps implement a Cufon fallback. These new improvements will make their way into Modernizr 1.2.</p>
<p>I&#039;ve also added on a isFontFaceSupported <a href="http://paulirish.com/2009/font-face-feature-detection/#sniff">browser sniffing alternative</a>. The main benefit here is that you&#039;re guaranteed accurate results synchronously. (The true feature detection can&#039;t do that,  though the new small size is much faster in Firefox.)</p>
<h4>Other bits and bobs</h4>
<p>The nice guys at that <i title="tee hee">other</i> jQuery Podcast <a href="http://bit.ly/8zaike">had me on the show</a> in November. I talked about, well.. basically all of the stuff above. :) It&#039;s a good show.</p>
<p>I tweeted about a new quick approach to a for loop:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> len <span style="color: #339933;">=</span> arr.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> <span style="color: #339933;">++</span>i <span style="color: #339933;">&lt;</span> len<span style="color: #339933;">;</span> <span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// the cool guy loop</span></pre></div></div>

<p>The fun part is that the counting expression (the third part) is empty. It&#039;s <a title="Screenshots showing it's perf increase" href="http://paulirish.com/i/d9f0.png">faster</a> than your standard loops, but reverse while() is still quicker. <small>@jdalton beat me to this one, for the record.</small></p>
<p>Lastly, along with my writers, I&#039;ve been keeping my mp3 blog <a href="http://aurgasm.us">Aurgasm</a> fresh with new music you&#039;ll love. I&#039;ve got a lot more things in the pipeline, so right after my Christmas and New Years jaunt around Germany, Denmark, and Scotland, you&#039;ll see them soon. Happy December ya&#039;ll.</p>
]]></content:encoded>
			<wfw:commentRss>http://paulirish.com/2009/updates-from-all-around-dec-2009/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Memorable hex colors</title>
		<link>http://paulirish.com/2009/memorable-hex-colors/</link>
		<comments>http://paulirish.com/2009/memorable-hex-colors/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 05:50:07 +0000</pubDate>
		<dc:creator>Paul Irish</dc:creator>
		
		<category><![CDATA[front-end development]]></category>

		<guid isPermaLink="false">http://paulirish.com/?p=517</guid>
		<description><![CDATA[Hopefully this will save you a trip back to Photoshop&#039;s color picker. 

#b00b00
#de1e7e
#e1e100
#BADA55
#F0FEAF
#ac1d1c
#facade

These ones are memorable, but not terribly color-appropriate:

 #c0ffee
 #defec8
 #deface
 #0ff1ce
 #a55

Thx for the awesome suggestions: @mrspeaker, @8centsaday, @wilto, @lrbabe, @twalve
If you have any good ones to add, holler in the comments! 

#post-517 li {
font-family:Consolas,Courier,Courier New;
font-size:20px;
height:19px;
line-height:21px;
list-style-type:none;
margin:5px;
padding:4px;
width:85px;
}


function contrast(color){ return '#' + 
  [...]]]></description>
			<content:encoded><![CDATA[<p>Hopefully this will save you a trip back to Photoshop&#039;s color picker. </p>
<ul>
<li title="great for errors!">#b00b00</li>
<li title="Are you sure you want to delete? Confirm!">#de1e7e</li>
<li title="old mcdonald had a farm..">#e1e100</li>
<li title="naturally">#BADA55</li>
<li title="highlights!">#F0FEAF</li>
<li title="corrosive! omg!">#ac1d1c</li>
<li title="pink. totally.">#facade</li>
</ul>
<p>These ones are memorable, but not terribly color-appropriate:</p>
<ul>
<li> #c0ffee</li>
<li> #defec8</li>
<li> #deface</li>
<li> #0ff1ce</li>
<li> #a55</li>
</ul>
<p>Thx for the awesome suggestions: <a href="http://twitter.com/mrspeaker">@mrspeaker</a>, <a href="http://twitter.com/8centsday">@8centsaday</a>, <a href="http://twitter.com/wilto">@wilto</a>, <a href="http://twitter.com/lrbabe">@lrbabe</a>, <a href="http://twitter.com/twalve">@twalve</a><br />
If you have any good ones to add, holler in the comments! </p>
<style>
#post-517 li {
font-family:Consolas,Courier,Courier New;
font-size:20px;
height:19px;
line-height:21px;
list-style-type:none;
margin:5px;
padding:4px;
width:85px;
}
</style>
<p><script>
function contrast(color){ return '#' + 
   (Number('0x'+color.substr(1)).toString(10) > 0xffffff/2 ? '000000' :  'ffffff'); 
}
$(function(){
$('#post-517 .content li').each(function(){ 
   var color = $(this).text().toUpperCase().replace(/\s+/g,'');
   $(this).css({background: color , color : contrast(color)} );
});
});
</script></p>
<p>I guess I have <a href="http://paulirish.com/2009/random-hex-color-code-snippets/">a thing for hex colors</a>.. ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://paulirish.com/2009/memorable-hex-colors/feed/</wfw:commentRss>
		</item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 1.208 seconds --><!-- Cached page generated by WP-Super-Cache on 2010-09-01 11:05:28 -->
