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 Doubles When Mixin is used #9430

Closed
ElijahFowler opened this issue Aug 13, 2013 · 1 comment
Closed

Clearfix Doubles When Mixin is used #9430

ElijahFowler opened this issue Aug 13, 2013 · 1 comment

Comments

@ElijahFowler
Copy link

When the .clearfix() mixin is used it outputs two sets of clearfix css. Like such:

.dl-horizontal dt {
  float: left;
  width: 160px;
  clear: left;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dl-horizontal dd {
  margin-left: 180px;
}
.dl-horizontal dd:before,
.dl-horizontal dd:after {
  content: "";
  display: table;
}
.dl-horizontal dd:after {
  clear: both;
}

This is caused by having the mixin and the clearfix in the utilities with the same name.

Mixin

.clearfix() {
  &:before,
  &:after {
    content: "";
    display: table;
  }
  &:after {
    clear: both;
  }
}

Utility

.clearfix {
  .clearfix();
}

I suggest fixing it by removing the parentheses on the mixing and removing the utility call altogether, that way the clearfix specific css will be generated but it still can be used as a mixin.

@BBosman
Copy link
Contributor

BBosman commented Aug 13, 2013

It's been reported before: #8947

@mdo mdo closed this as completed Aug 13, 2013
mdo added a commit that referenced this issue Dec 9, 2013
Original discussion:
less/less.js#1437 (comment).

Since we’re switching to `grunt-contrib-less`, we can take advantage of
newer LESS features than what RECESS supported. Included in that is the
ability to `:extend`, and not only that, but `:extend(.mixin-name
all)`. By doing so, we remove duplicate CSS for all our elements that
were being clearfix-ed.

Fixes #8947, #8968, #8991, #9257, #9268, #9291, #9430, #9604, #9686,
#9929, #10731, #10793, #11305, #11498, #11533, #11570, #11604, #11652.

(dem issues, tho)
stempler pushed a commit to stempler/bootstrap that referenced this issue Apr 11, 2014
Original discussion:
less/less.js#1437 (comment).

Since we’re switching to `grunt-contrib-less`, we can take advantage of
newer LESS features than what RECESS supported. Included in that is the
ability to `:extend`, and not only that, but `:extend(.mixin-name
all)`. By doing so, we remove duplicate CSS for all our elements that
were being clearfix-ed.

Fixes twbs#8947, twbs#8968, twbs#8991, twbs#9257, twbs#9268, twbs#9291, twbs#9430, twbs#9604, twbs#9686,
twbs#9929, twbs#10731, twbs#10793, twbs#11305, twbs#11498, twbs#11533, twbs#11570, twbs#11604, twbs#11652.

(dem issues, tho)
stempler pushed a commit to stempler/bootstrap that referenced this issue Nov 4, 2014
Original discussion:
less/less.js#1437 (comment).

Since we’re switching to `grunt-contrib-less`, we can take advantage of
newer LESS features than what RECESS supported. Included in that is the
ability to `:extend`, and not only that, but `:extend(.mixin-name
all)`. By doing so, we remove duplicate CSS for all our elements that
were being clearfix-ed.

Fixes twbs#8947, twbs#8968, twbs#8991, twbs#9257, twbs#9268, twbs#9291, twbs#9430, twbs#9604, twbs#9686,
twbs#9929, twbs#10731, twbs#10793, twbs#11305, twbs#11498, twbs#11533, twbs#11570, twbs#11604, twbs#11652.

(dem issues, tho)
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

3 participants