Created
August 19, 2009 00:18
-
-
Save ashebanow/170069 to your computer and use it in GitHub Desktop.
adaptation of The 1KB CSS Grid to sass (http://www.1kbgrid.com/). I love Sass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* adaptation of The 1KB CSS Grid to sass (http://www.1kbgrid.com/). I love Sass. | |
// To use: | |
@import 1kbgrid.sass | |
+1kbgrid(12, 60px, 10px) | |
=1kbgrid(!num_columns = 12, !column_width = 60px, !gutter = 10px) | |
// calculated values | |
!gutter_margin = !gutter / 2 | |
!total_column_width = !column_width + !gutter | |
!row_width = !total_column_width * !num_columns | |
@for !i from 1 through !num_columns | |
.grid_#{!i} | |
width = (!total_column_width * !i) - !gutter | |
.column | |
margin = 0 !gutter_margin | |
overflow: hidden | |
float: left | |
display: inline | |
.row | |
width = !row_width | |
margin: 0 auto | |
overflow: hidden | |
.row | |
margin = 0 -!gutter_margin | |
width: auto | |
display: inline-block |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment