Forked from hatefulcrawdad/ie8-grid-foundation-4.css
Last active
December 14, 2015 10:38
-
-
Save benpsnyder/5073000 to your computer and use it in GitHub Desktop.
a .scss version with a 24 col grid
This file contains hidden or 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
| // | |
| // 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