Created
June 17, 2013 20:05
-
-
Save jensgro/5799857 to your computer and use it in GitHub Desktop.
Einfacher Grid-Generator mit Sass
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
// --- | |
// Sass (v3.2.9) | |
// --- | |
$seitenbreite: 960px; | |
$anzahl-grids: 6; | |
$horizontaler-abstand: 10px; | |
$eine-spalte: $seitenbreite / $anzahl-grids; | |
$eine-spalte-prozent: $eine-spalte/$seitenbreite*100 *1%; | |
//$eine-spalte-prozent: ($seitenbreite / $anzahl-grids) / $seitenbreite*100; | |
@for $i from 1 to $anzahl-grids { | |
.grid#{$i} { width: $eine-spalte-prozent * $i;} | |
} | |
.grid1-test { | |
width: $seitenbreite/$anzahl-grids - $horizontaler-abstand * 2; | |
} | |
.grid1-test-prozent { | |
width: $eine-spalte-prozent; | |
} |
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
.grid1 { | |
width: 16.66667%; | |
} | |
.grid2 { | |
width: 33.33333%; | |
} | |
.grid3 { | |
width: 50.0%; | |
} | |
.grid4 { | |
width: 66.66667%; | |
} | |
.grid5 { | |
width: 83.33333%; | |
} | |
.grid1-test { | |
width: 140px; | |
} | |
.grid1-test-prozent { | |
width: 16.66667%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment