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

Incorrect margin-left and margin-right on .row-class when using odd @grid-gutter-width #20106

Closed
malthejorgensen opened this issue Jun 10, 2016 · 1 comment
Labels

Comments

@malthejorgensen
Copy link

malthejorgensen commented Jun 10, 2016

Steps to reproduce

  1. Choose an odd @grid-gutter-width, e.g. @grid-gutter-width: 15px
  2. Compile bootstrap Less-stylesheets

Problem
The left and right margin .row class, which should normally "cancel out" the left and right padding of the .col-*-* classes is actually flipped so that instead cancelling out, there's a one pixel difference between the two:

.row {
  margin-left:  -7px; /* should be -8px */
  margin-right: -8px; /* should be -7px */
}

.col-md-12 {
  padding-left:  8px;
  padding-right: 7px;
}

Reason
The reason why this happens is that in .row the ceil() and floor()-functions are used on negative numbers: margin-left: ceil(-7.5px) == -7px, as opposed to the .col-*-*-classes where it's used in a standard way on positive numbers: padding-left: ceil(7.5px) == 8px, which ends up giving the one pixel difference. As ceil()/floor() rounds towards negative/positive infinity, rather than towards/away from zero.

The bug was introduced with the fix for: #16281

@mdo
Copy link
Member

mdo commented Jun 12, 2016

Bootstrap 3 is essentially in maintenance mode as we focus on working towards a stable v4. As such, we're only accepting changes to v3's code on a case-by-case basis, usually only for critical bug fixes or docs improvements.

Sorry for the inconvenience, and thanks for the suggestion, but we'll be passing on this change.

<3

@mdo mdo closed this as completed Jun 12, 2016
@mdo mdo removed this from the v3.3.7 milestone Jun 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants