Skip to content

Comment on Twitter's Bootstrap 2 ready for testing and feedbackparent

Comments

In Haml:

  .span3
    = render :partial => "col1"
  .span3
    = render :partial => "col2"
  .span3
    = render :partial => "col3"
  .span3
    = render :partial => "col4"
Or, to do 3-col:
  .span4
    = render :partial => "col1"
  .span4
    = render :partial => "col2"
  .span4
    = render :partial => "col3"
Nothing in the partial needs to especially care about the grid (as long as its simple) --- but if it wanted to, it could nest columns.

or better yet, you have semantically named elements and assign them column values in your .less file:

    #sidebar {
      .makeColumn(4);
    }
    #main_pane {
      .makeColumn(8);
    }

    #sidebar
      = render :partial => 'common/sidebar'
    #main_pane
      = yield
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.