Skip to content

Commit

Permalink
Fix 1px rounding issue for flexbox grids in Safari peterramsing#260
Browse files Browse the repository at this point in the history
  • Loading branch information
hudochenkov committed Feb 17, 2016
1 parent f174c06 commit a0c973a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
11 changes: 2 additions & 9 deletions lib/lost-column.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,11 @@ module.exports = function lostColumnDecl(css, settings) {
newBlock(
decl,
':nth-child('+ lostColumnCycle +'n)',
['margin-right'],
[0]
['margin-right', 'margin-left'],
[0, 'auto']
);
}

newBlock(
decl,
':nth-child('+ lostColumnCycle +'n)',
['float'],
['right']
);

newBlock(
decl,
':last-child',
Expand Down
4 changes: 2 additions & 2 deletions lib/lost-waffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ module.exports = function lostWaffleDecl(css, settings) {
newBlock(
decl,
':nth-child('+ lostWaffleCycle + 'n)',
['margin-right', 'float'],
[0, 'right']
['margin-right', 'margin-left'],
[0, 'auto']
);
}

Expand Down
3 changes: 1 addition & 2 deletions test/lost-column.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ describe('lost-column', function() {
' }\n' +
'a:nth-child(1n) { margin-right: 60px; }\n' +
'a:last-child { margin-right: 0; }\n' +
'a:nth-child(3n) { float: right; }\n' +
'a:nth-child(3n) { margin-right: 0; }'
'a:nth-child(3n) { margin-right: 0; margin-left: auto; }'
);
});
it('provides none rule', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/lost-waffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('lost-waffle', function() {
' height: calc(99.999999% * 2/5); }\n' +
'a:nth-child(1n) { margin-right: 0; margin-bottom: 0; }\n' +
'a:last-child { margin-right: 0; margin-bottom: 0; }\n' +
'a:nth-child(3n) { margin-right: 0; float: right; }\n' +
'a:nth-child(3n) { margin-right: 0; margin-left: auto; }\n' +
'a:nth-last-child(-n + 3) { margin-bottom: 0; }'
);
});
Expand Down

0 comments on commit a0c973a

Please sign in to comment.