Skip to content

Commit

Permalink
Switch to &:extend(.clearfix all) for clearfix mixin
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
mdo committed Dec 9, 2013
1 parent 2a4621b commit 0016c17
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 239 deletions.
267 changes: 41 additions & 226 deletions dist/css/bootstrap.css
Original file line number Diff line number Diff line change
Expand Up @@ -554,22 +554,6 @@ dd {
.dl-horizontal dd {
margin-left: 180px;
}
.dl-horizontal dd:before,
.dl-horizontal dd:after {
display: table;
content: " ";
}
.dl-horizontal dd:after {
clear: both;
}
.dl-horizontal dd:before,
.dl-horizontal dd:after {
display: table;
content: " ";
}
.dl-horizontal dd:after {
clear: both;
}
}
abbr[title],
abbr[data-original-title] {
Expand Down Expand Up @@ -684,22 +668,6 @@ pre code {
margin-right: auto;
margin-left: auto;
}
.container:before,
.container:after {
display: table;
content: " ";
}
.container:after {
clear: both;
}
.container:before,
.container:after {
display: table;
content: " ";
}
.container:after {
clear: both;
}
@media (min-width: 768px) {
.container {
width: 750px;
Expand All @@ -721,42 +689,10 @@ pre code {
margin-right: auto;
margin-left: auto;
}
.container-fluid:before,
.container-fluid:after {
display: table;
content: " ";
}
.container-fluid:after {
clear: both;
}
.container-fluid:before,
.container-fluid:after {
display: table;
content: " ";
}
.container-fluid:after {
clear: both;
}
.row {
margin-right: -15px;
margin-left: -15px;
}
.row:before,
.row:after {
display: table;
content: " ";
}
.row:after {
clear: both;
}
.row:before,
.row:after {
display: table;
content: " ";
}
.row:after {
clear: both;
}
.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
position: relative;
min-height: 1px;
Expand Down Expand Up @@ -1935,22 +1871,6 @@ textarea.input-lg {
margin-right: -15px;
margin-left: -15px;
}
.form-horizontal .form-group:before,
.form-horizontal .form-group:after {
display: table;
content: " ";
}
.form-horizontal .form-group:after {
clear: both;
}
.form-horizontal .form-group:before,
.form-horizontal .form-group:after {
display: table;
content: " ";
}
.form-horizontal .form-group:after {
clear: both;
}
.form-horizontal .form-control-static {
padding-top: 7px;
}
Expand Down Expand Up @@ -3113,22 +3033,6 @@ input[type="button"].btn-block {
.btn-group .btn-group + .btn-group {
margin-left: -1px;
}
.btn-toolbar:before,
.btn-toolbar:after {
display: table;
content: " ";
}
.btn-toolbar:after {
clear: both;
}
.btn-toolbar:before,
.btn-toolbar:after {
display: table;
content: " ";
}
.btn-toolbar:after {
clear: both;
}
.btn-toolbar .btn-group {
float: left;
}
Expand Down Expand Up @@ -3224,22 +3128,6 @@ input[type="button"].btn-block {
width: 100%;
max-width: 100%;
}
.btn-group-vertical > .btn-group:before,
.btn-group-vertical > .btn-group:after {
display: table;
content: " ";
}
.btn-group-vertical > .btn-group:after {
clear: both;
}
.btn-group-vertical > .btn-group:before,
.btn-group-vertical > .btn-group:after {
display: table;
content: " ";
}
.btn-group-vertical > .btn-group:after {
clear: both;
}
.btn-group-vertical > .btn-group > .btn {
float: none;
}
Expand Down Expand Up @@ -3436,22 +3324,6 @@ textarea.input-group-sm > .input-group-btn > .btn {
margin-bottom: 0;
list-style: none;
}
.nav:before,
.nav:after {
display: table;
content: " ";
}
.nav:after {
clear: both;
}
.nav:before,
.nav:after {
display: table;
content: " ";
}
.nav:after {
clear: both;
}
.nav > li {
position: relative;
display: block;
Expand Down Expand Up @@ -3645,43 +3517,11 @@ textarea.input-group-sm > .input-group-btn > .btn {
margin-bottom: 20px;
border: 1px solid transparent;
}
.navbar:before,
.navbar:after {
display: table;
content: " ";
}
.navbar:after {
clear: both;
}
.navbar:before,
.navbar:after {
display: table;
content: " ";
}
.navbar:after {
clear: both;
}
@media (min-width: 768px) {
.navbar {
border-radius: 4px;
}
}
.navbar-header:before,
.navbar-header:after {
display: table;
content: " ";
}
.navbar-header:after {
clear: both;
}
.navbar-header:before,
.navbar-header:after {
display: table;
content: " ";
}
.navbar-header:after {
clear: both;
}
@media (min-width: 768px) {
.navbar-header {
float: left;
Expand All @@ -3696,22 +3536,6 @@ textarea.input-group-sm > .input-group-btn > .btn {
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
-webkit-overflow-scrolling: touch;
}
.navbar-collapse:before,
.navbar-collapse:after {
display: table;
content: " ";
}
.navbar-collapse:after {
clear: both;
}
.navbar-collapse:before,
.navbar-collapse:after {
display: table;
content: " ";
}
.navbar-collapse:after {
clear: both;
}
.navbar-collapse.in {
overflow-y: auto;
}
Expand Down Expand Up @@ -4264,22 +4088,6 @@ textarea.input-group-sm > .input-group-btn > .btn {
text-align: center;
list-style: none;
}
.pager:before,
.pager:after {
display: table;
content: " ";
}
.pager:after {
clear: both;
}
.pager:before,
.pager:after {
display: table;
content: " ";
}
.pager:after {
clear: both;
}
.pager li {
display: inline;
}
Expand Down Expand Up @@ -4819,22 +4627,6 @@ a.list-group-item-info.active:focus {
.panel-body {
padding: 15px;
}
.panel-body:before,
.panel-body:after {
display: table;
content: " ";
}
.panel-body:after {
clear: both;
}
.panel-body:before,
.panel-body:after {
display: table;
content: " ";
}
.panel-body:after {
clear: both;
}
.panel > .list-group {
margin-bottom: 0;
}
Expand Down Expand Up @@ -5173,22 +4965,6 @@ button.close {
text-align: right;
border-top: 1px solid #e5e5e5;
}
.modal-footer:before,
.modal-footer:after {
display: table;
content: " ";
}
.modal-footer:after {
clear: both;
}
.modal-footer:before,
.modal-footer:after {
display: table;
content: " ";
}
.modal-footer:after {
clear: both;
}
.modal-footer .btn + .btn {
margin-bottom: 0;
margin-left: 5px;
Expand Down Expand Up @@ -5608,11 +5384,50 @@ button.close {
}
}
.clearfix:before,
.clearfix:after {
.clearfix:after,
.container:before,
.container:after,
.container-fluid:before,
.container-fluid:after,
.row:before,
.row:after,
.form-horizontal .form-group:before,
.form-horizontal .form-group:after,
.btn-toolbar:before,
.btn-toolbar:after,
.btn-group-vertical > .btn-group:before,
.btn-group-vertical > .btn-group:after,
.nav:before,
.nav:after,
.navbar:before,
.navbar:after,
.navbar-header:before,
.navbar-header:after,
.navbar-collapse:before,
.navbar-collapse:after,
.pager:before,
.pager:after,
.panel-body:before,
.panel-body:after,
.modal-footer:before,
.modal-footer:after {
display: table;
content: " ";
}
.clearfix:after {
.clearfix:after,
.container:after,
.container-fluid:after,
.row:after,
.form-horizontal .form-group:after,
.btn-toolbar:after,
.btn-group-vertical > .btn-group:after,
.nav:after,
.navbar:after,
.navbar-header:after,
.navbar-collapse:after,
.pager:after,
.panel-body:after,
.modal-footer:after {
clear: both;
}
.center-block {
Expand Down
2 changes: 1 addition & 1 deletion dist/css/bootstrap.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions less/button-groups.less
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

// Optional: Group multiple button groups together for a toolbar
.btn-toolbar {
.clearfix();
&:extend(.clearfix all);

.btn-group {
float: left;
Expand Down Expand Up @@ -157,7 +157,7 @@

// Clear floats so dropdown menus can be properly placed
> .btn-group {
.clearfix();
&:extend(.clearfix all);
> .btn {
float: none;
}
Expand Down
Loading

0 comments on commit 0016c17

Please sign in to comment.