At SXSW 2009, Paul Irish showed me his initial work on HTML5 Boilerplate and asked if it was something I would be interested in contributing to. It was a no-brainer to say yes. I was thinking about creating something similar myself (as I’m sure you were too!) We quickly ramped up production and released it to the wild about three weeks ago.
HTML5 Boilerplate is a compilation of best practices that would help any web developer get started on their code. It also catches some of the stuff developers usually miss when in a hurry to meet deadlines (e.g. print and mobile styles, making sure www and www-less domains redirect correctly, getting servers to serve the right content types for new or relatively unknown file formats and having a backup for jQuery in case the CDNed jQuery fails).
I heartily recommend that everyone delete some of the things that may not be applicable to their production environment, like if you don’t write unit tests, you may not want to use the unit test suite. You’re allowed to pick and choose!
Boilerplate is made up of snippets from all over! And they’re all documented! Here are some of the goodies you’ll find:
- Use of the new HTML5 elements without worrying about cross-browser compatibility.
- Optimal caching and compression rules for better webpage performance.
- Mobile browser optimizations.
- Build a better experience for all users with feature detection.
- A ready-to-use unit test suite.
It was great fun to work on this project because we had to think several times before including or deleting a snippet. We had to rationalize the existence of each. I also spent hours testing on several mobile browsers to check how the default mobile styles were rendered.
We aren’t done yet though, Paul is working to get a build script going which would automate some of the recommended performance best practices. Others have pitched in with WordPress and Compass ports. I makes me very happy to see so many people rallying behind it and contributing!
So, go have fun with Boilerplate. I bet you’ll have a brilliant insight or two, so feel free to fork and tinker with it!
FYI, the project is in the public domain, so you really can do whatever the hell you want with it :)