Skip to content

Commit

Permalink
(less) Fix for issue twbs#12854 where push and pull resets
Browse files Browse the repository at this point in the history
The col-*-push-0 and col-*-pull-0 classes try to reset the positioning using 0% but this prevents the opposite direction positioning to freeze and not being set correctly.
To fix that, these must set the position to auto instead of 0% with means left:auto and right:auto instead of left:0% and right:0%.
  • Loading branch information
Sojaner committed Feb 27, 2014
1 parent 0b05413 commit 8faa5ca
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions mixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -827,16 +827,26 @@
width: percentage((@index / @grid-columns));
}
}
.calc-grid-column(@index, @class, @type) when (@type = push) {
.calc-grid-column(@index, @class, @type) when (@type = push) and (@index > 0) {
.col-@{class}-push-@{index} {
left: percentage((@index / @grid-columns));
}
}
.calc-grid-column(@index, @class, @type) when (@type = pull) {
.calc-grid-column(@index, @class, @type) when (@type = push) and (@index = 0) {
.col-@{class}-push-0 {
left: auto;
}
}
.calc-grid-column(@index, @class, @type) when (@type = pull) and (@index > 0) {
.col-@{class}-pull-@{index} {
right: percentage((@index / @grid-columns));
}
}
.calc-grid-column(@index, @class, @type) when (@type = pull) and (@index = 0) {
.col-@{class}-pull-0 {
right: auto;
}
}
.calc-grid-column(@index, @class, @type) when (@type = offset) {
.col-@{class}-offset-@{index} {
margin-left: percentage((@index / @grid-columns));
Expand Down

0 comments on commit 8faa5ca

Please sign in to comment.