Skip to content

Instantly share code, notes, and snippets.

@onishiweb
Last active February 16, 2017 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onishiweb/1a36a5c47b4faa3675f9 to your computer and use it in GitHub Desktop.
Save onishiweb/1a36a5c47b4faa3675f9 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v3.1.0)
// ----
// ===================================
// Grid settings
// ===================================
$gutter:15px;
$grid-columns:12;
// ===================================
// Grid mixins
// ===================================
@mixin grid-item($cols) {
float:left;
width:percentage($cols/$grid-columns);
margin-bottom:$gutter;
padding-left:$gutter;
}
@mixin grid-pull-right($cols) {
float:right;
margin-right:percentage(-$cols/$grid-columns);
}
@mixin grid-pull-left($cols) {
margin-left:percentage(-$cols/$grid-columns);
padding-right:$gutter;
}
// ===================================
// Usage
// ===================================
.article {
@include grid-item(8);
}
.aside {
@include grid-item(4);
}
blockquote {
@include grid-item(3);
@include grid-pull-left(2);
}
.article {
float: left;
width: 66.66667%;
margin-bottom: 15px;
padding-left: 15px; }
.aside {
float: left;
width: 33.33333%;
margin-bottom: 15px;
padding-left: 15px; }
blockquote {
float: left;
width: 25%;
margin-bottom: 15px;
padding-left: 15px;
margin-left: -16.66667%;
padding-right: 15px; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment