CSS Frameworks are amazing. The world has enough of them – but you should still make one more. If you write CSS for a living I’m convinced the best thing you could do to foster this skill is build your own site-agnostic framework.I remember the first time I really dug into a CSS Framework – Twitter Bootstrap. I only used the framework on one or two projects, but some of the coding methods and modules have changed the way I approach certain layout issues. It was really eye opening to work so closely with well thought out object oriented code, and to learn the pitfalls, and wrong ways to use it.
Fast forward a couple months and I was soon aware of Bootstrap alternatives like Zurb Foundation, Yahoo! Pure, and my personal favourite Inuit CSS. There are actually hundreds of these things. I’m sure they’re all super valuable and great – but you surely won’t need to compare them all to find the right solution for you. I think the best thing you could do is to make your own.
If you’ve ever struggled to make a site completely follow a naming convention, or a methodology like OOCSS, or if you work with a team that all bring their own coding styles to a project, nothing could be more valuable than a standard code base everyone works from.
Building your own framework is a daunting task. I’m not for a second recommending that you reinvent the wheel. Look at how other frameworks are made, read case studies, and start snooping under the hood at sites that have consistent and broadly ranged styles. Over time make them your own.
Don’t have the time to build a framework? I totally get that too. In that case I’d recommend adopting an existing and popular one (popularity is helpful for finding help and documentation). Fork it, and customize it as you go (I highly recommend Inuit CSS; it’s modular design means you can easily swap out modules you don’t like. It’s trivially easy to bring something as big as your own grid system into it for example).
I’ve been reading and working about CSS methodologies like OOCSS and SMACSS for years – but only in the last two months have I really been knuckled down and co-authoring a framework that is entirely made of modular abstractions. Though it’s still not complete I can tell the result of these weeks of work is going to radically change how I build sites. The only con is how awkward it feels working on sites that aren’t object oriented.
It’s ironic that through this exercise I feel my CSS skills have increased drastically, and this work is making it so I will only have to write a fraction of the CSS that I ever did before on a site.