Archive

Archive for the ‘front-end development’ Category

Announcing: HTML5 Boilerplate

August 10th, 2010

When kicking off a new project, I'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'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 peek through the source to get a feel of what's inside. And if you think there's too much? Delete key that badboy.

I'm very interested in your contributions.. what else deserves to be in this base template?

Paul Irish front-end development

High-res browser icons

August 4th, 2010

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 instead of taking the true icon assets. If you would like to create proper non-scaled small sizes, I'd gladly accept them. :)

Paul Irish front-end development

Details on the new Google Webfont API

May 19th, 2010

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…

Here's adding a @font-face declaration for Tangerine, a nice scripty font:

<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Tangerine">

You'll then reference it font-family:Tangerine and be all set. As for something a bit more complicated:

<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Inconsolata:italic,bolditalic|Droid+Sans">

There's Inconsolata regular, italic and bold-italic and Droid Sans regular.

There is a high-quality curated portfolio of open fonts available (Raph Levien, designer of Inconsolata guided this project). And view the real documentation on the CSS api.

Obviously there are huge caching benefits to using the Google Font API, plus they're very focused on performance and you can expect things to be fast and FOUT to be minimized. But on the topic of FOUT…

The WebFont Loader is also making its debut. This is a javascript library collaboration between the good boys at Typekit and Google. It basically allows a lot of control over the display details of webfonts.

Let's say you want Firefox to not have the FOUT, but rather mimic webkit's behavior of invisible text until the font is loaded:

<script src="http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"></script>
<script>
  WebFont.load({
    google: {
      families: ['Cantarell']
    }
  });
</script>
<style>
  .wf-loading h1 { visibility: hidden; }
  .wf-active h1, .wf-inactive h1 { 
    visibility: visible; font-family: 'Cantarell'; 
  }
</style>

The WebFont Loader API provides some classes on the <html> element (a la Modernizr) and a bunch of javascript callbacks.

Check out all the WebFont demos, showing off all its capabilities. One of my favorite parts is that you can use the events and hooks it provides with your very own hosted fonts (in that demo I load Taggeschrift from paulirish.com).

The webfont loader is now an open-source project on github. Feel free to peek under the covers. Oh and do check the project docs: getting started, webfont loader, technicalities, and faq.

Ask any questions in the comments and I'll do my best to clarify. :)

2010.05.19: The Google webfont previewer tool (with jQuery!) is pretty tight, too.

2010.05.20: Update via Florian to use .wf-loading to hide for FOUT prevention.

Take a look at some of my other (recently updated) webfont stuff:

Paul Irish front-end development, typography

Bug tracker short urls

May 4th, 2010

I'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's chrome os

In fact, the webk.it URLs are debuting today! I luckily convinced Wolfango Chiappella of Wolfango'Studio (who owns the domain) to set up a redirect. Grazie di cuore!

2010.07.22: Mihai of the google reader team added a nice new one for chromium changesets: http://crrev.com/41850
Mozilla also has a mysterious URL shortener for all of their MDC docs and such, but I don't know how it works other than bit.ly using it automatically. *magic!*

Paul Irish front-end development

SVG Filters on HTML5 video

March 28th, 2010

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's the most fun to apply it to <video>, though I could have done it to any HTML. Peep the video:

Demo page: SVG filters on html5 <video> (requires a Firefox nightly)

Blur is certainly the most useful, I'd say. For instance, Mike Matas's new site could dynamically blur the images instead of manually cutting blurred jpgs.

Leave a comment if you can think of other use cases for filters like these on your HTML content.

Paul Irish front-end development

i left this space here for you to play. <3