Skip to content

Instantly share code, notes, and snippets.

@benpsnyder
Forked from hatefulcrawdad/ie8-grid-foundation-4.css
Last active December 14, 2015 10:38
Show Gist options
  • Select an option

  • Save benpsnyder/5073000 to your computer and use it in GitHub Desktop.

Select an option

Save benpsnyder/5073000 to your computer and use it in GitHub Desktop.
a .scss version with a 24 col grid
//
// Grid Variables
//
$total-columns: 24 !default;
// Grid Calculation for Percentages
@function gridCalc($colNumber, $totalColumns) {
@return percentage(($colNumber / $totalColumns));
}
.lt-ie9 {
/* The Grid ---------------------- */
.row {
width: 940px;
max-width: 100%;
min-width: 768px;
margin: 0 auto;
.row {
width: auto;
max-width: none;
min-width: 0;
margin: 0 -15px;
&.normal-collapse { margin: 0; }
}
&.normal-collapse {
.column,
.columns { padding: 0; }
}
}
.column, .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.column.normal-centered, .columns.normal-centered { float: none; margin: 0 auto; }
[class*="column"] + [class*="column"]:last-child { float: right; }
[class*="column"] + [class*="column"].end { float: left; }
@for $i from 1 through $total-columns {
.normal-#{$i},
.row .normal-#{$i} { width: gridCalc($i,$total-columns); }
}
@for $i from 1 through $total-columns - 2 {
.row .normal-offset-#{$i} { margin-left: gridCalc($i,$total-columns); }
}
@for $i from 2 through $total-columns - 2 {
.pull-#{$i} { right: gridCalc($i,$total-columns); }
.push-#{$i} { left: gridCalc($i,$total-columns); }
}
/* Nicolas Gallagher's micro clearfix */
.row {
*zoom: 1;
&:before, .row:after { content: " "; display: table; }
&:after { clear: both; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment