Skip to content

Instantly share code, notes, and snippets.

@klickreflex
Last active August 29, 2015 14:02
Show Gist options
  • Save klickreflex/39340f7a82d3bd8c0803 to your computer and use it in GitHub Desktop.
Save klickreflex/39340f7a82d3bd8c0803 to your computer and use it in GitHub Desktop.
// Your custom SCSS should be written here...
@import "fancytilesoutside";
// apply fancytilesoutside to the element containing your tiles (eg the <ul> tag)
ul.fancy {
@include fancytilesoutside(3,2,1);
}
@function divide-cols($colnum) {
@return 100%/$colnum;
}
@mixin fancytilesoutside($desktop-columns, $tablet-columns: $desktop-columns, $mobile-columns: 1, $small-break: 0px, $medium-break: $tablet-device-width, $large-break: $row-max-width) {
margin-left: -$gutter / 2;
margin-right: -$gutter / 2;
> *{
// These styles apply to all shift-columns
display: inline-block;
float: left;
padding-left: $gutter / 2;
padding-right: $gutter / 2;
// IE8 fallback
width: divide-cols($mobile-columns);
@include respond("min-width: #{$small-break}") {
width: divide-cols($mobile-columns);
}
@include respond("min-width: #{$medium-break}") {
width: divide-cols($tablet-columns);
}
@include respond("min-width: #{$large-break}") {
width: divide-cols($desktop-columns);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment