Skip to content

Instantly share code, notes, and snippets.

@anttti
Created August 20, 2013 11:00
Show Gist options
  • Save anttti/6280063 to your computer and use it in GitHub Desktop.
Save anttti/6280063 to your computer and use it in GitHub Desktop.
Simple SCSS grid system
.row {
width: 100%;
max-width: $document-max-width;
margin-left: auto;
margin-right: auto;
margin-top: 0;
margin-bottom: $general-padding;
&:before, &:after {
content: " ";
display: table;
}
&:after {
clear: both;
}
.row {
width: auto;
margin-left: -0.9375em;
margin-right: -0.9375em;
margin-top: 0;
margin-bottom: 0;
}
}
.column {
position: relative;
padding-left: 0.9375em;
padding-right: 0.9375em;
width: 100%;
float: left;
}
[class*="column"] + [class*="column"]:last-child {
float: right;
}
[class*="column"] + [class*="column"].end {
float: left;
}
[class^="grid-units"] {
position: relative;
}
@for $i from 1 to 11 {
.grid-units-#{$i} {
width: $i * 8.33333%;
}
.grid-units-offset-#{$i} {
margin-left: $i * 8.33333%;
}
}
@anttti
Copy link
Author

anttti commented Aug 20, 2013

Simplified from Foundation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment