Skip to content

Instantly share code, notes, and snippets.

@ste2425
Created July 20, 2016 14:35
Show Gist options
  • Save ste2425/42d07755ec6febc843b037ce47bfe7f9 to your computer and use it in GitHub Desktop.
Save ste2425/42d07755ec6febc843b037ce47bfe7f9 to your computer and use it in GitHub Desktop.
response grid layout
/*
Variables:
$screen-size-small
$screen-size-medium
$screen-size-large
$grid-small-screen-width
$grid-medium-screen-width
$grid-large-screen-width
$grid-column-count
*/
.grid-row {
&:before,
&:after {
visibility: hidden;
display: block;
content: "";
height: 0;
clear: both;
}
&.margin {
margin-bottom: 10px;
}
@media (mix-width: $screen-size-small) {
width: $grid-small-screen-width;
}
@media (mix-width: $screen-size-medium) {
width: $grid-medium-screen-width;
}
@media (mix-width: $screen-size-large) {
width: $grid-large-screen-width;
}
}
@mixin make-columns($columnCount) {
@if (round($columnCount) !=$columnCount) {
@error "Grid system can only use integer column count. It will not round.";
}
@for $i from 1 through $columnCount {
.grid-span-#{$i} {
width: percentage($i / $columnCount);
float: left;
box-sizing: border-box;
}
}
}
@include make-columns($grid-column-count);
@andre7755
Copy link

hahahahahaha yes

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