Bootstrap, Foundation, Bulma, Tailwind, PureCSS, Materialize, and so forth: the idea of building your own CSS framework might sound like pure madness with so many ready-made CSS libraries out there.
But there might be some valid reasons that lead to taking up such a challenge. In this article, I will try to list the ones that convinced me to build a custom CSS framework for our Cruip templates.
First and very debatable point! Productivity is what all of us should always keep the focus on, and that means to make things work with less time and effort. So why should I want to waste time just to reinvent the wheel?
Well, I think it depends on what you are working on. If you need to go fast, building a custom framework it's not a good move. In our case we wanted a solid, scalable and easy to maintain scaffold, and here's why we thought that doing everything from scratch was a more appropriate choice.
During the prototyping stage of Cruip, we defined some fundamental principles:
- We didn't want fluid, percent-based layouts
- We didn't need grids yet
- We wanted to define the white-space in multiples of 4
- We wanted to adopt pixel only as measure unit
- I needed a settings file to store custom variables for our sections and components
- I needed Sass mixins and functions from my Swiss Army knife
Way too many needs for adopting a CSS framework. That's why we decided to build our own system.
Generally speaking, I don't like to have things that I don't need around me. That applies to both life and job.
Every CSS library provides you much more than you need, and I prefer to spend my time writing new code rather than wasting time to remove unused code.
I've just said that building a CSS framework is time-consuming, but it's a one-time job.
I spent almost 3 months writing, testing, and fixing the base CSS for Cruip. What we get now is a solid skeleton that we can re-use anytime we need to build a landing page. Also, I can re-cycle my work for any of my future projects, aside from improving or extending it accordingly with the needs of the moment.
Not of secondary importance: it's my creature, and I can feel much more comfortable with it rather than with code written, maintained and updated by anyone else.
Coding a CSS framework from scratch can be an exciting experience. You will test your skills at 360 degrees and it will force you to view things from a larger perspective. Definitely an experience that I would recommend!