Skip to content

Instantly share code, notes, and snippets.

View brendanmckeown's full-sized avatar

Brendan McKeown brendanmckeown

  • Philadelphia, PA
View GitHub Profile
@brendanmckeown
brendanmckeown / clearfix-placeholder
Created April 17, 2015 18:22
Sass clearfix placeholder. Apply to parent selector that has floated children.
%clearfix {
&:before,
&:after {
content: " ";
display: table;
}
&:after {
clear: both;
}
}
@brendanmckeown
brendanmckeown / equal-grid-columns.scss
Last active August 29, 2015 14:19
Sass mixin for equal multi-column layout. Include in the parent selector and specify the number of columns, the size of the gap between columns, and the direct children selector. Depends on a clearfix solution for the parent, and assumes you have applied "box-sizing: border-box" at a global level. Example: http://jsfiddle.net/brendanmckeown/gzr8…
@mixin equal-grid-columns($columns, $gap, $el) {
@include clearfix;
> #{$el} {
float: left;
width: (100% / $columns);
$halfGap: ($gap / 2);
padding: 0 $halfGap;
margin-top: $gap;
@for $i from 1 through $columns {
@brendanmckeown
brendanmckeown / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console