| 1 |
// @doc off |
| 2 |
// Extends the bottom of the element to enclose any floats it contains. |
| 3 |
// @doc on |
| 4 |
|
| 5 |
@import "hacks"; |
| 6 |
|
| 7 |
// This basic method is preferred for the usual case, when positioned |
| 8 |
// content will not show outside the bounds of the container. |
| 9 |
// |
| 10 |
// Recommendations include using this in conjunction with a width. |
| 11 |
// Credit: [quirksmode.org](http://www.quirksmode.org/blog/archives/2005/03/clearing_floats.html) |
| 12 |
@mixin clearfix { |
| 13 |
overflow: hidden; |
| 14 |
@include has-layout; |
| 15 |
} |
| 16 |
|
| 17 |
// This older method from Position Is Everything called |
| 18 |
// [Easy Clearing](http://www.positioniseverything.net/easyclearing.html) |
| 19 |
// has the advantage of allowing positioned elements to hang |
| 20 |
// outside the bounds of the container at the expense of more tricky CSS. |
| 21 |
@mixin legacy-pie-clearfix { |
| 22 |
&:after { |
| 23 |
content : "\0020"; |
| 24 |
display : block; |
| 25 |
height : 0; |
| 26 |
clear : both; |
| 27 |
overflow : hidden; |
| 28 |
visibility : hidden; |
| 29 |
} |
| 30 |
@include has-layout; |
| 31 |
} |
| 32 |
|
| 33 |
// This is an updated version of the PIE clearfix method that reduces the amount of CSS output. |
| 34 |
// If you need to support Firefox before 3.5 you need to use `legacy-pie-clearfix` instead. |
| 35 |
// |
| 36 |
// Adapted from: [A new micro clearfix hack](http://nicolasgallagher.com/micro-clearfix-hack/) |
| 37 |
@mixin pie-clearfix { |
| 38 |
&:after { |
| 39 |
content: ""; |
| 40 |
display: table; |
| 41 |
clear: both; |
| 42 |
} |
| 43 |
@include has-layout; |
| 44 |
} |