Forked from chriseppstein/this_does_not_work.scss
Last active
December 17, 2015 23:19
-
-
Save nex3/5688559 to your computer and use it in GitHub Desktop.
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
@mixin clearfix { | |
*zoom: 1; | |
&:after { | |
content: ""; | |
display: table; | |
clear: both; | |
} | |
} | |
@mixin generate-grid($cols, $width) { | |
%grid-base { | |
float: left; | |
@include clearfix; | |
} | |
@for $i from 1 through $cols { | |
.col-#{$i} { | |
@extend %grid-base; | |
width: $width * $i / $cols; | |
} | |
} | |
} | |
@media (all) and (min-width: 480px) { | |
@include generate-grid(12, 720px); | |
} | |
@media (all) and (min-width: 800px) { | |
@include generate-grid(24, 960px); | |
} | |
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
@mixin clearfix { | |
*zoom: 1; | |
&:after { | |
content: ""; | |
display: table; | |
clear: both; | |
} | |
} | |
@mixin generate-grid($cols, $width) { | |
$base: unique(); | |
$selectors: (); | |
@for $i from 1 through $cols { | |
$selectors: append($selectors, unquote(".col-#{$i}"), comma); | |
.col-#{$i} { | |
width: $width * $i / $cols; | |
} | |
} | |
#{$selectors} { | |
float: left; | |
@include clearfix; | |
} | |
} | |
@media (all) and (min-width: 480px) { | |
@include generate-grid(12, 720px); | |
} | |
@media (all) and (min-width: 800px) { | |
@include generate-grid(24, 960px); | |
} |
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
@mixin clearfix { | |
*zoom: 1; | |
&:after { | |
content: ""; | |
display: table; | |
clear: both; | |
} | |
} | |
@mixin generate-grid($cols, $width) { | |
$base: unique-id(); | |
%#{$base} { | |
float: left; | |
@include clearfix; | |
} | |
@for $i from 1 through $cols { | |
.col-#{$i} { | |
@extend %#{$base}; | |
width: $width * $i / $cols; | |
} | |
} | |
} | |
@media (all) and (min-width: 480px) { | |
@include generate-grid(12, 720px); | |
} | |
@media (all) and (min-width: 800px) { | |
@include generate-grid(24, 960px); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment