Skip to content

Instantly share code, notes, and snippets.

@davestacey
Last active August 29, 2015 14:02
Show Gist options
  • Save davestacey/6f9fcd6c8cdb8cabc28e to your computer and use it in GitHub Desktop.
Save davestacey/6f9fcd6c8cdb8cabc28e to your computer and use it in GitHub Desktop.
Clearfix mixin
@mixin clearfix {
&:after, &:before {
content: "";
display: table;
}
&:after {
clear: both;
}
& {
*zoom: 1;
}
}
%clearfix {
@include clearfix;
}
.clearfix {
@extend %clearfix;
}
// OLD:
// Mixin for Clearfix
/*
%clearfix {
&:after {
content: "";
display: table;
clear: both;
}
}
*/
// OLD - REMOVE AFTER TESTING
/*
.clearfix {
*zoom: 1;
}
.clearfix:after {
content: "";
display: table;
clear: both;
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment