A CSS framework is a library of CSS styles which allow developers to reuse certain properties easily without having to code CSS from scratch. Initially when creating a web page they can save time but once you get involved in more complex designs, are they really all they’re cracked up to be?
CSS frameworks are useful for creating quick, robust layouts and do prevent problems occurring especially in the cross browser department whilst for the most part have been thoroughly tested and will stand up to older browsers. But isn’t it better to understand CSS fully and what constraints some browsers have rather than relying on a framework to take care of any issues? How will a web designer feel about working on a project or debugging browser issues if they’ve been totally reliant on a specific framework for all their development projects?
Un-semantic naming conventions
If a web designer fully understands all the complexities of CSS and still decides to use a framework than that’s fair enough but I suspect that anyone that is experienced with CSS would just choose to create any code from scratch.
HTML and CSS work fantastic together because they separate the content from the presentation, however with the majority of frameworks this simply isn’t the case. Yes, they may well use class’s and ID’s appended to div and span elements but when you look deeper into how the code has been written, it’s no different to actually writing styles inline.
For example, take the following code:
class="column span-15 gutter-1"
Now assume that the column class is floated left, the span-15 class is 150px wide and the gutter-1 class applies a right margin of 10px. How is this any different to just writing the following?
style="float: left; width: 150px; margin-right: 10px;"
One does use an external stylesheet but whichever way you look at it, a designer is still going to have to go into the HTML code and change the class in order to alter the presentation, but isn’t this what CSS is supposed to be for?
Imagine if you’d created a site that had grown over the years to a 1000+ pages and you needed to tweak the width of one column? I’d much rather go into one CSS file and change the width of that ID or class rather than trawl through every page of the site and have to change the class in the HTML page.
When I’m creating CSS from scratch, I’ll only create CSS that I’m going to use. Sometimes I’ll also throw in an ID for generic messages like .error or .confirmation for example which I know may come in handy but the idea of CSS frameworks is that grids and presentational styles are created for a huge array of possibilities which in reality a web designer will never use on that project and therefore a large CSS file has to be served up to the end user despite only a fraction of it being used.
As you may have gathered, I don’t use CSS frameworks when it comes to web development and in the majority of cases believe that it simply increases the amount of code used and makes it harder for designers working on the project later to update and manage the code.
What do you think? Do you use CSS frameworks? Have they ever saved you time when developing websites or have they ever presented you with unexpected problems further down the line?