A mixin to help clear the element it is mixed into #59

wants to merge 1 commit into


None yet

3 participants


I find myself having to clear a lot of elements and thought this mixin should make its way into bourbon since it could potentially see a lot of use.

#foo {
  @include cleared;
  float: left;

allows one to

<div id="foo">To the left, to the left</div>

I should clear

rather than having to do

<div id="foo">To the left, to the left</div>
<div style="clear: both; visibility: hidden"></div>

I should clear

Additionally, can also

@include cleared(left);
@include cleared(right);

I personally don't think that a clearfix hack belongs with the css3 mixins. I also think the micro clearfix is a better clearing method as it prevents collapsing margins in modern browsers.

I added my proposed changes to this pull request.


merged in the clearfix: ac172bc

@frechg frechg closed this Feb 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment