Skip to content

Instantly share code, notes, and snippets.

@robtarr
Created September 7, 2012 13:33
Show Gist options
  • Save robtarr/3666287 to your computer and use it in GitHub Desktop.
Save robtarr/3666287 to your computer and use it in GitHub Desktop.
SASS Grouping function
.elementA:before,
.elementB:before,
.elementA:after,
.elementB:after { content: ""; display: table; }
.elementA:after
.elementB:after { clear: both; }
.elementA,
.elementB { *zoom: 1; }
%clearfix {
&:before,
&:after { content: ""; display: table; }
&:after { clear: both; }
{ *zoom: 1; }
}
.elementA {
@extend %clearfix;
}
.elementB {
@extned clearfix;
}
A little help from Patrick Fulton pointed me in the direction of better understanding @extend. Exactly what I wanted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment