Bower

Bower is a straight-forward package manager for front-end dependencies.

Roll your own SVG sprite sheets with Bower and Gulp

In this article I will show you how to integrate a custom set of open source icons into a project using Bower (a front-end package manager) and Gulp (a command line task runner). This isn’t exactly the sort of tutorial where you can copy and paste a bunch of code and get up and running—it is more a collection of working notes and scraps of code meant to point you in the right direction. I will assume readers have a basic understanding of modern front-end development tools and the command line. I happen to be using WordPress and PHP to implement the markup but also include some vanilla JavaScript that could be adapted for use pretty much anywhere.

Continue reading →

Local development with Bower

Recently I extracted a library of Sass mixins from one of my existing projects so that it could be reused in some of my other projects. Since I already use Bower to manage front-end dependencies I followed this guide to register my library as a Bower component, which isn’t very hard to do. Next, I added my library back into the original project by executing bower install [project].

Bower only recognizes released versions (i.e. those that have been tagged). This is fine if your component is tested and ready to ship but somewhat problematic if you wish to continue developing it locally, as I do. This article introduces bower link, a command that creates a symlink between locally developed Bower components and any other local project using Bower. Usage is easier than the somewhat arcane documentation would suggest; simply run bower link from the root directory of your new Bower component and follow up with bower link [project] from the root directory of whatever other project you’re working on.

WordPress theme development with Gulp, Bower, and Sass

Update February 2015: this post is now out of date as the starter kit has evolved. I’m working on a new post to explain all the developments; in the meantime please check out the original repo on GitHub. Thanks!

WordPress theme development is remarkably more efficient with Gulp, a Node-based build system and task runner similar to Grunt. Gulp has been widely hyped in recent times—and no wonder, it’s a major time-saver. I found out about Gulp by way of this excellent introduction by Mark Goodyear, later adapting the build script in this post by Matt Banks for my own use.

Since then I have refined my workflow to the point where I figure it might be helpful for me to share my approach with the WordPress community. With this in mind I have prepared this starter kit (with source code on GitHub) to demonstrate how you can use Gulp with Bower and Sass to optimize your WordPress theme development workflow. This starter kit does not contain any actual WordPress theme files—it is meant to act as the scaffolding that surrounds your theme and supports your workflow.

Continue reading →