Skip to content

Instantly share code, notes, and snippets.

@mattmccray
Created July 17, 2009 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattmccray/149233 to your computer and use it in GitHub Desktop.
Save mattmccray/149233 to your computer and use it in GitHub Desktop.
Simple, SASS based, grid system
!columns ||= 12
!column_width ||= 60
!column_margin ||= 20
.row
overflow: hidden
margin: 0 auto
width: #{!columns * !column_width + !columns * !column_margin}px
.row
margin: 0 -#{!column_margin / 2}px
display: inline-block
width: auto
@for !i from 1 through !columns
.column_#{!i}
float: left
overflow: hidden
display: inline
margin: 0 #{!column_margin / 2}px
width: #{!column_width * !i + !column_margin * (!i - 1)}px
!columns = 12
!column_width = 60
!column_margin = 20
@import grid.sass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment