Hacker News new | ask | show | jobs
by tptacek 5259 days ago
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.
1 comments

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