Twitter Bootstrap or Zurb Foundation for RailsApps?

My goal with the RailsApps project is to provide stable example applications, first as starter applications for experienced developers, and second to help students and newcomers learn Rails.

A year ago, Twitter Bootstrap seemed an obvious choice as a front-end framework for the example applications. It is popular, and judging from the Big Badass List of Useful Twitter Bootstrap Resources, it has huge third-party support.

On August 19, 2013, Twitter Bootstrap 3.0 replaced Twitter Bootstrap 2.3 with major changes. Unfortunately, using Bootstrap with Sass and Rails means relying on 3rd party gems which have been slow to update for Bootstrap 3.0, since Bootstrap uses LESS as a CSS preprocessor and doesn’t support Rails or Sass (the Rails CSS preprocssor) directly.

Compounding the problem, I recommend and use SimpleForm for form helpers with the RailsApps example applications. SimpleForm supports Twitter Bootstrap 2.3 very nicely. But the changes in Twitter Bootstrap 3.0 introduced incompatibilities with SimpleForm. For several months I’ve been hoping to see the issues resolved but so far, it is a work in progress (for good reason; Rafael Fran├ža is very busy as a member of the Rails core team).

Earlier this year, I released an in-depth tutorial and example application for Twitter Bootstrap 2.3. I’ve been repeatedly asked to update it for Twitter Bootstrap 3.0. I’ll do so when the SimpleForm issue is resolved.

There’s a more important issue, though. What do I recommend to Rails beginners? For the last six months, I’ve been writing Learn Ruby on Rails, a book for Rails beginners. It’s a solid book, covering Rails 4.0 and introducing professional practices. The book provides newcomers with everything they need to use the more advanced RailsApps tutorials. Until this week, it was based on Twitter Bootstrap 2.3.

Today I’ve released a new version of the book that introduces Zurb Foundation 4.0 instead of Twitter Bootstrap. For the book, Foundation is a better choice. Foundation uses Sass as a CSS pre-processor, as does Rails. Zurb supports Rails directly with a gem; using Twitter Bootstrap with Sass means relying on third-party gems. Though Twitter Bootstrap 2.3 is very popular among Rails developers, I’ve seen a trend of Rails developers choosing Foundation. Consequently, I feel I am in good company in recommending Foundation to students.

Going forward, for the RailsApps example applications, I will support a choice of either Zurb Foundation or Twitter Bootstrap. I’ve just released the RailsLayout gem which generates a default application layout plus partials for flash messages and navigation for either simple CSS, Zurb Foundation 4, or Twitter Bootstrap 3. The RailsLayout gem integrates with the Rails Composer to produce starter apps using either Zurb Foundation or Twitter Bootstrap.

I’ve had tremendous support from the Rails community both for the book (especially the Kickstarter campaign) and the RailsApps project. Supporting two front-end frameworks will make it more difficult to allocate the project’s limited resources (my time). Picking a stack is a difficult decision. I hope I’ve made the right choice.

5 notesShowHide

  1. rails-apps posted this