Skip to content

Instantly share code, notes, and snippets.

@funkaoshi
Created March 2, 2010 03:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save funkaoshi/319102 to your computer and use it in GitHub Desktop.
Save funkaoshi/319102 to your computer and use it in GitHub Desktop.
// http://1kbgrid.com as a sass file.
//
// To use, import this file into another sass file that sets all the variables.
// For example, I use this within the following sass file to generate the grid
// for my iPhone blog
//
// !column_width = 40px
// !gutter_width = 20px
// !number_of_columns = 11
//
// @import grid.sass
//
@for !i from 1 through !number_of_columns
.grid_#{!i}
width = (!column_width + !gutter_width) * !i - !gutter_width
.column
margin = "0 #{!gutter_width / 2}"
overflow: hidden
float: left
display: inline
.row
width = (!column_width + !gutter_width) * !number_of_columns
margin: 0 auto
overflow: hidden
.row
margin = "0 -#{!gutter_width / 2}"
width: auto
display: inline-block
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment