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

display:table in .clearfix rule may create unwanted gaps between blocks #19983

Closed
thierryk opened this issue May 29, 2016 · 2 comments
Closed

Comments

@thierryk
Copy link

The clearfix rule has changed to reflect the latest new clearfix so far but as this more recent article explains, display:table may create unwanted gaps between blocks.

So my suggestion is to replace the existing _clearfix.scss:

@mixin clearfix() {
  &::after {
    content: "";
    display: table;
    clear: both;
  }
}

with:

@mixin clearfix() {
  &::after {
    content: "";
    display: block;
    clear: both;
  }
}
@cvrebert cvrebert changed the title The clearfix rule may create unwanted gaps between blocks display:table in .clearfix rule may create unwanted gaps between blocks May 29, 2016
@cvrebert
Copy link
Collaborator

CC: @mdo for review

@mdo mdo added this to the v4.0.0-alpha.6 milestone Nov 28, 2016
@mdo mdo added the has-pr label Nov 28, 2016
@thierryk
Copy link
Author

It may be worth editing the documention too as it says:

Easily clear floats by adding .clearfix to the parent element. Utilizes the micro clearfix as popularized by Nicolas Gallagher. Can also be used as a mixin.

since the new rule does not have much to do with the "micro clearfix" anymore.

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

No branches or pull requests

3 participants