Skip to content

Commit

Permalink
Allow any selector to be used as clearfix instead of just a classname
Browse files Browse the repository at this point in the history
  • Loading branch information
sporkd committed Aug 22, 2010
1 parent d4022c1 commit e93912e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 6 additions & 4 deletions stylesheets/html5-boilerplate/_helpers.scss
Expand Up @@ -9,7 +9,7 @@

.visuallyhidden { @include visually-hidden; }

@include magnificent-clearfix;
@include clearfix;
}

// for image replacement
Expand Down Expand Up @@ -37,7 +37,9 @@
@mixin invisible { visibility: hidden; }

// The Magnificent CLEARFIX
@mixin magnificent-clearfix($classname: 'clearfix') {
.#{$classname}:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.#{$classname} { zoom: 1; }
// Make any element or classname a
// clearfix by passing in a selector
@mixin clearfix($selector: '.clearfix') {
#{$selector}:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
#{$selector} { zoom: 1; }
}
4 changes: 3 additions & 1 deletion templates/project/partials/_html5_boilerplate.scss
Expand Up @@ -62,7 +62,9 @@ sup { vertical-align: super; font-size: smaller; }

.visuallyhidden { @include visually-hidden; }

@include magnificent-clearfix('clearfix'); // Override with custom class-name
// Make any element or classname behave as
// clearfix by passing in a selector
@include clearfix('.clearfix');


//--------------------------------
Expand Down

0 comments on commit e93912e

Please sign in to comment.