Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clearfix is considered unsemantic. #12

Closed
MartinMuzatko opened this issue Feb 19, 2014 · 1 comment
Closed

Clearfix is considered unsemantic. #12

MartinMuzatko opened this issue Feb 19, 2014 · 1 comment

Comments

@MartinMuzatko
Copy link

Hi there!

Using clear or clearfix as float containment rule name is not really todays best practice.
http://colinaarts.com/articles/float-containment/
http://css-tricks.com/snippets/css/clear-fix/
"group" class name is nicer and more semantic (via Dan Cederholm). Content property doesn't even need the space, can be empty string (via Nicolas Gallagher). Without any text, font-size is un-needed (Chris Coyier).

Besides, you could actually implement the clearfix in the .grid
Maybe take a look on this example https://github.com/MartinMuzatko/WebKick/blob/framework/css/layout.css

Please let me know if this is either accurate or not.

@aekaplan
Copy link
Owner

Hi Martin,

Correct! I actually use Sass but wanted Grid to be accessible to beginners. I use @extend:

%clearfix {
  *zoom: 1;
  &:before, &:after {
    content: " ";
    display: table;
  }
  &:after {
    clear: both;
  }
}
.container-with-floated-children {
  @extend %clearfix;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants