Last active
October 30, 2018 12:59
-
-
Save jslegers/6048393 to your computer and use it in GitHub Desktop.
Clearfix code without duplication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%display-block-hacked { | |
display: block; | |
*zoom: 1; | |
} | |
%clear-both { | |
clear : both; | |
} | |
%blank-as-table { | |
display: table; | |
content: " "; | |
} | |
%clearfix { | |
&:before{ | |
@extend %blank-as-table; | |
} | |
& { | |
@extend %display-block-hacked; | |
} | |
&:after { | |
@extend %blank-as-table; | |
@extend %clear-both; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example use :
SCSS INPUT :
CSS OUTPUT :