Skip to content

Commit 2cb9c9e

Browse files
author
Cory Simmons
committed
Fix IE rounding error
1 parent 3b58ce8 commit 2cb9c9e

File tree

2 files changed

+46
-46
lines changed

2 files changed

+46
-46
lines changed

scss/lost.scss

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Lost Grid v3.0.4 - https://github.com/corysimmons/lost
1+
// Lost Grid v3.0.5 - https://github.com/corysimmons/lost
22

33
$gutter: 30px !default;
44
$rtl: false !default;
@@ -241,19 +241,19 @@ $rtl: false !default;
241241
@if ($masonry-friendly == false) {
242242
@if ($gut != 0) {
243243
@if ($cycle != 1) {
244-
width: calc(100% * #{$fraction} - (#{$gut} - #{$gut} / #{$cycle}));
244+
width: calc(99.999% * #{$fraction} - (#{$gut} - #{$gut} / #{$cycle}));
245245
} @else {
246-
width: calc(100% * #{$fraction} - (#{$gut} - #{$gut} / #{$denominator}));
246+
width: calc(99.999% * #{$fraction} - (#{$gut} - #{$gut} / #{$denominator}));
247247
}
248248
} @else {
249-
width: calc(100% * #{$fraction});
249+
width: calc(99.999% * #{$fraction});
250250
}
251251

252252
} @else {
253253
@if ($gut != 0) {
254-
width: calc(100% * #{$fraction} - #{$gut});
254+
width: calc(99.999% * #{$fraction} - #{$gut});
255255
} @else {
256-
width: calc(100% * #{$fraction});
256+
width: calc(99.999% * #{$fraction});
257257
}
258258
}
259259
}
@@ -270,9 +270,9 @@ $rtl: false !default;
270270

271271
@if ($output == normal) or ($output == bare) {
272272
@if ($gut != 0) {
273-
height: calc(100% * #{$fraction} - (#{$gut} - #{$gut} / #{$denominator}));
273+
height: calc(99.999% * #{$fraction} - (#{$gut} - #{$gut} / #{$denominator}));
274274
} @else {
275-
height: calc(100% * #{$fraction});
275+
height: calc(99.999% * #{$fraction});
276276
}
277277
}
278278
}
@@ -339,14 +339,14 @@ $rtl: false !default;
339339
@if ($output == normal) or ($output == bare) {
340340
@if ($gut != 0) {
341341
@if ($cycle != 1) {
342-
width: calc(100% * #{$fraction} - (#{$gut} - #{$gut} / #{$cycle}));
342+
width: calc(99.999% * #{$fraction} - (#{$gut} - #{$gut} / #{$cycle}));
343343
} @else {
344-
width: calc(100% * #{$fraction} - (#{$gut} - #{$gut} / #{$denominator}));
344+
width: calc(99.999% * #{$fraction} - (#{$gut} - #{$gut} / #{$denominator}));
345345
}
346-
height: calc(100% * #{$fraction} - (#{$gut} - #{$gut} / #{$denominator}));
346+
height: calc(99.999% * #{$fraction} - (#{$gut} - #{$gut} / #{$denominator}));
347347
} @else {
348-
width: calc(100% * #{$fraction});
349-
height: calc(100% * #{$fraction});
348+
width: calc(99.999% * #{$fraction});
349+
height: calc(99.999% * #{$fraction});
350350
}
351351
}
352352
}
@@ -370,9 +370,9 @@ $rtl: false !default;
370370
margin-left: -($gut / 2);
371371
margin-right: -($gut / 2);
372372
@if ($gut != 0) {
373-
width: calc(100% + #{$gut});
373+
width: calc(99.999% + #{$gut});
374374
} @else {
375-
width: 100%;
375+
width: 99.999%;
376376
}
377377
}
378378

@@ -454,26 +454,26 @@ $rtl: false !default;
454454
@if ($gut > 0) {
455455
@if ($numerator > 0) {
456456
@if ($masonry-friendly) {
457-
margin-left: calc(100% * #{$fraction} + (#{$gut} / 2));
457+
margin-left: calc(99.999% * #{$fraction} + (#{$gut} / 2));
458458
} @else {
459-
margin-left: calc(100% * #{$fraction} - (#{$gut} - #{$gut} / #{$denominator}) + #{$gut});
459+
margin-left: calc(99.999% * #{$fraction} - (#{$gut} - #{$gut} / #{$denominator}) + #{$gut});
460460
}
461461
}
462462
@if ($numerator < 0) {
463463
$fraction: nth(sl-explode($fraction, '-'), 2);
464464
@if ($masonry-friendly) {
465-
margin-right: calc(100% * #{$fraction} + (#{$gut} / 2));
465+
margin-right: calc(99.999% * #{$fraction} + (#{$gut} / 2));
466466
} @else {
467-
margin-right: calc(100% * #{$fraction} - (#{$gut} - #{$gut} / #{$denominator}) + (#{$gut} * 2));
467+
margin-right: calc(99.999% * #{$fraction} - (#{$gut} - #{$gut} / #{$denominator}) + (#{$gut} * 2));
468468
}
469469
}
470470
}
471471
@if ($gut == 0) {
472472
@if ($numerator > 0) {
473-
margin-left: calc(100% * #{$fraction});
473+
margin-left: calc(99.999% * #{$fraction});
474474
}
475475
@if ($numerator < 0) {
476-
margin-right: calc(-100% * #{$fraction});
476+
margin-right: calc(-99.999% * #{$fraction});
477477
}
478478
}
479479
}
@@ -523,9 +523,9 @@ $rtl: false !default;
523523
}
524524
@if ($output == normal) or ($output == bare) {
525525
@if ($cycle != 1) {
526-
left: calc(#{$spots} * (100% * #{$fraction} - (#{$gut} - #{$gut} / #{$cycle}) + #{$gut}));
526+
left: calc(#{$spots} * (99.999% * #{$fraction} - (#{$gut} - #{$gut} / #{$cycle}) + #{$gut}));
527527
} @else {
528-
left: calc(#{$spots} * (100% * #{$fraction} - (#{$gut} - #{$gut} / #{$denominator}) + #{$gut}));
528+
left: calc(#{$spots} * (99.999% * #{$fraction} - (#{$gut} - #{$gut} / #{$denominator}) + #{$gut}));
529529
}
530530
}
531531
}

stylus/lost.styl

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Lost Grid v3.0.4 - https://github.com/corysimmons/lost
1+
// Lost Grid v3.0.5 - https://github.com/corysimmons/lost
22

33
$gutter = 30px
44
$rtl = false
@@ -164,16 +164,16 @@ block($fraction = '1/1', $dir = row, $cycle = 1, $gut = $gutter, $output = norma
164164
if $masonry-friendly is false
165165
if $gut != 0
166166
if $cycle != 1
167-
width: s('calc(100% * %s - (%s - %s / %s))', unquote($fraction), $gut, $gut, $cycle)
167+
width: s('calc(99.999% * %s - (%s - %s / %s))', unquote($fraction), $gut, $gut, $cycle)
168168
else
169-
width: s('calc(100% * %s - (%s - %s / %s))', unquote($fraction), $gut, $gut, $denominator)
169+
width: s('calc(99.999% * %s - (%s - %s / %s))', unquote($fraction), $gut, $gut, $denominator)
170170
else
171-
width: s('calc(100% * %s)', unquote($fraction))
171+
width: s('calc(99.999% * %s)', unquote($fraction))
172172
else
173173
if $gut != 0
174-
width: s('calc(100% * %s - %s)', unquote($fraction), $gut)
174+
width: s('calc(99.999% * %s - %s)', unquote($fraction), $gut)
175175
else
176-
width: s('calc(100% * %s)', unquote($fraction))
176+
width: s('calc(99.999% * %s)', unquote($fraction))
177177

178178
if $dir is column
179179
if $output is normal or $output is init
@@ -182,9 +182,9 @@ block($fraction = '1/1', $dir = row, $cycle = 1, $gut = $gutter, $output = norma
182182
margin-bottom: 0
183183
if $output is normal or $output is bare
184184
if $gut != 0
185-
height: s('calc(100% * %s - (%s - %s / %s))', unquote($fraction), $gut, $gut, $denominator)
185+
height: s('calc(99.999% * %s - (%s - %s / %s))', unquote($fraction), $gut, $gut, $denominator)
186186
else
187-
height: s('calc(100% * %s)', unquote($fraction))
187+
height: s('calc(99.999% * %s)', unquote($fraction))
188188

189189
if $dir is both
190190
if $output is normal or $output is init
@@ -227,13 +227,13 @@ block($fraction = '1/1', $dir = row, $cycle = 1, $gut = $gutter, $output = norma
227227
if $output is normal or $output is bare
228228
if $gut != 0
229229
if $cycle != 1
230-
width: s('calc(100% * %s - (%s - %s / %s))', $fraction, $gut, $gut, $cycle)
230+
width: s('calc(99.999% * %s - (%s - %s / %s))', $fraction, $gut, $gut, $cycle)
231231
else
232-
width: s('calc(100% * %s - (%s - %s / %s))', unquote($fraction), $gut, $gut, $denominator)
233-
height: s('calc(100% * %s - (%s - %s / %s))', unquote($fraction), $gut, $gut, $denominator)
232+
width: s('calc(99.999% * %s - (%s - %s / %s))', unquote($fraction), $gut, $gut, $denominator)
233+
height: s('calc(99.999% * %s - (%s - %s / %s))', unquote($fraction), $gut, $gut, $denominator)
234234
else
235-
width: s('calc(100% * %s)', unquote($fraction))
236-
height: s('calc(100% * %s)', unquote($fraction))
235+
width: s('calc(99.999% * %s)', unquote($fraction))
236+
height: s('calc(99.999% * %s)', unquote($fraction))
237237

238238

239239
/**
@@ -253,9 +253,9 @@ masonry-row($gut = $gutter)
253253
margin-left: -($gut / 2)
254254
margin-right: -($gut / 2)
255255
if $gut is not 0
256-
width: s('calc(100% + %s)', $gut)
256+
width: s('calc(99.999% + %s)', $gut)
257257
else
258-
width: 100%
258+
width: 99.999%
259259

260260

261261
/**
@@ -282,20 +282,20 @@ offset($fraction = '1/1', $dir = row, $gut = $gutter, $masonry-friendly = false)
282282
if $gut > 0
283283
if $numerator > 0
284284
if $masonry-friendly
285-
margin-left: s('calc(100% * %s + (%s / 2))', unquote($fraction), $gut)
285+
margin-left: s('calc(99.999% * %s + (%s / 2))', unquote($fraction), $gut)
286286
else
287-
margin-left: s('calc(100% * %s - (%s - %s / %s) + %s)', unquote($fraction), $gut, $gut, $denominator, $gut)
287+
margin-left: s('calc(99.999% * %s - (%s - %s / %s) + %s)', unquote($fraction), $gut, $gut, $denominator, $gut)
288288
if $numerator < 0
289289
$fraction = split('-', $fraction)[1]
290290
if $masonry-friendly
291-
margin-right: s('calc(100% * %s + (%s / 2))', unquote($fraction), $gut)
291+
margin-right: s('calc(99.999% * %s + (%s / 2))', unquote($fraction), $gut)
292292
else
293-
margin-right: s('calc(100% * %s - (%s - %s / %s) + (%s * 2))', unquote($fraction), $gut, $gut, $denominator, $gut)
293+
margin-right: s('calc(99.999% * %s - (%s - %s / %s) + (%s * 2))', unquote($fraction), $gut, $gut, $denominator, $gut)
294294
if $gut is 0
295295
if $numerator > 0
296-
margin-left: s('calc(100% * %s)', unquote($fraction))
296+
margin-left: s('calc(99.999% * %s)', unquote($fraction))
297297
if $numerator < 0
298-
margin-right: s('calc(-100% * %s)', unquote($fraction))
298+
margin-right: s('calc(-99.999% * %s)', unquote($fraction))
299299

300300
if $dir is column
301301
if $gut > 0
@@ -334,9 +334,9 @@ move($fraction = '1/1', $spots = 1, $cycle = 1, $gut = $gutter, $output = normal
334334
position: relative
335335
if $output is normal or $output is bare
336336
if $cycle != 1
337-
left: s('calc(%s * (100% * %s - (%s - %s / %s) + %s))', $spots, unquote($fraction), $gut, $gut, $cycle, $gut)
337+
left: s('calc(%s * (99.999% * %s - (%s - %s / %s) + %s))', $spots, unquote($fraction), $gut, $gut, $cycle, $gut)
338338
else
339-
left: s('calc(%s * (100% * %s - (%s - %s / %s) + %s))', $spots, unquote($fraction), $gut, $gut, $denominator, $gut)
339+
left: s('calc(%s * (99.999% * %s - (%s - %s / %s) + %s))', $spots, unquote($fraction), $gut, $gut, $denominator, $gut)
340340

341341

342342
html, body

0 commit comments

Comments
 (0)