I’ve recently been working on a web app from the ground up. Bootstrap 3 was a good choice to get started - it is super easy to get a site up and running without having to worry too much about styling. In essence, it allowed me to build out some of the requirements with a wireframe-y front-end.
After a while, the designs for the app were ready and it was time to apply the styles to make the app look good. Before diving in, I chose to create a pattern library first - this article explains why.
What is a pattern library? Paul Boag describes it as a collection of user interface design patterns.
This is a nice, succinct description, but is also open to interpretation. At this point, I started to do some digging and look at other people’s pattern libraries, to see what the common focus is.
It seems that a common problem that a pattern library solves is to unify the design and act as a reference point for a development team. Could a pattern library still be useful for a one-man band, on a relatively smaller project?
It turns out, yes, it is very useful indeed.
In my particular case, I am building an app for a client remotely. I am based in Bristol and the client is in the North of England, and so we do not have the luxury of being in the same room to thrash out design ideas. Instead, we take to Trello and communicate backwards and forwards until things are right.
A pattern library is super useful for this:
I decided on creating a simple, single-page pattern library that sits alongside my Single Page Application (SPA) as a completely different HTML file. Here is an example of how it looks:
There is another big advantage I have found during the creation of the pattern library. Building each component separately and in isolation from one another helps to promote loose coupling of components within the stylesheet. Using a CSS preprocessor has further helped - by splitting out each section of the pattern library into modules, this forces me to create corresponding LESS modules. The result is cleaner, more maintainable styles.
If you are creating a new website or web application, I’d highly recommend creating a pattern library before applying the final styles to your app, regardless of the size of the project. It helps to reinforce modularity and provides a single place to view all styles, which is very useful as a reference point for later on when applying styles to the app itself.