-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
Wrong margin-bottom value when use offset #382
Comments
@pryann Could you do us a favor and do some cross-browser testing on that and determine that it does that for other browsers? |
@peterramsing Yes of course. I checked in Chrome 58, Firefox 53, Opera 46, Edge, the result is same, but if you would like, I will create a complex cross bowser test. |
@pryann That's good enough. Just wanted to make sure it wasn't a browser specific rounding. |
@peterramsing No, it doesn't a browser specific issue. If I make 3 row (lost-row: 1/3) everything if perfect, but if I use offfset, the margin-bottom value is wrong (calc(99.9% * 1/3 - (30px - 30px * 1/3) + (30px * 2)) !important). |
@pryann If you want to jump start the fix could you write some failing tests for this? |
@peterramsing I found what is the problem, and I know the solution. The example:
The height of the main div is 100% (in this case 974px). You use the next formula in the lost-offset.js file, line 83:
A the third row causes the problem. ((30px - 30px * 1/3)). If you subtract only just the gutter, the problem is solved. This works for me.
I cheked the negative offset value too. Example:
The problem is same. You use the next formula in the lost-offset.js file, line 97:
But the next works perfectly for me:
Please check it. I hope it will work. |
It looks like there might be something more wrong here... I'm not able to replicate your issue but instead am getting something worse. I'm thinking I might need to tear up that code and figure out what the heck is going on...the maths is all wrong. <div class="main">
<div>first</div>
<div>second</div>
</div> @lost rounder 100;
.main {
lost-center: 1000px 15px;
height: 500px;
background: #faa;
}
.main > div {
lost-row: 1/3;
background: #aaf;
}
.main div:first-child {
lost-offset: 1/3 column;
} |
The update on this is that I spent several plane rides trying to figure out what's what w/o any CSS documentation to read about what is actually happening. My next steps are to see how Bootstrap and other grids do the same thing and see if I can figure it out that way. |
Is this a feature request or a bug report?
Bug
Hello,
If I create a simple grid:
Than I format them:
The second div is out of the main div.
I attached a file.
Thanks.
The text was updated successfully, but these errors were encountered: