Archive for March, 2007

Linking in Style… CSS3 Selectors for the Win

Today, we made a couple subtle but visually helpful additions to hyperlink styles in our site-wide CSS. We used some advanced features of CSS3 to isolate off-site links, to add an extra background image and padding to the link, based on how MediaWiki handles off-site links. We also added a mail icon to mailto: e-mail […]

Automatic Pull-quotes with Behaviour and CSS

Our new favorite toy around here is automatic pull-quotes using Javascript and CSS. We wanted an elegant and aesthetically pleasing way to add interest, gravitas, and improve the scannability of some of our pages, especially when an image is unavailable or inappropriate. After a little digging around, we discovered that Roger Johansson at 456 Berea […]

Shaun Inman’s Widon’t Ported to Javascript

I was working on some pull-quote magic today (more on that later) and needed to de-widow a string in Javascript a la Shaun Inman’s Widon’t. So I ported it to Javascript. Here’s the magic: String.prototype.widont = function() { return this.replace(/([^\s])\s+([^\s]+)\s*$/, '$1 $2'); } // end widont() To use this simply call the widont() method on a […]