diff --git a/lib/lost-waffle.js b/lib/lost-waffle.js index b6377566..1a4e85cf 100644 --- a/lib/lost-waffle.js +++ b/lib/lost-waffle.js @@ -111,15 +111,8 @@ module.exports = function lostWaffleDecl(css, settings) { newBlock( decl, ':nth-child('+ lostWaffleCycle + 'n)', - ['float'], - ['right'] - ); - - newBlock( - decl, - ':nth-child('+ lostWaffleCycle +'n)', - ['margin-right'], - [0] + ['margin-right', 'float'], + [0, 'right'] ); } @@ -155,15 +148,8 @@ module.exports = function lostWaffleDecl(css, settings) { newBlock( decl, ':nth-child('+ lostWaffleCycle + 'n)', - ['float'], - ['right'] - ); - - newBlock( - decl, - ':nth-child('+ lostWaffleCycle +'n)', - ['margin-right'], - [0] + ['margin-right', 'float'], + [0, 'right'] ); } diff --git a/test/lost-waffle.js b/test/lost-waffle.js index cbc6430b..fe7f326f 100644 --- a/test/lost-waffle.js +++ b/test/lost-waffle.js @@ -11,8 +11,7 @@ describe('lost-waffle', function() { 'a:nth-child(1n) { float: left; margin-right: 30px;' + ' margin-bottom: 30px; clear: none; }\n' + 'a:last-child { margin-right: 0; margin-bottom: 0; }\n' + - 'a:nth-child(3n) { margin-right: 0; }\n' + - 'a:nth-child(3n) { float: right; }\n' + + 'a:nth-child(3n) { margin-right: 0; float: right; }\n' + 'a:nth-child(3n + 1) { clear: left; }\n' + 'a:nth-last-child(-n + 3) { margin-bottom: 0; }' ); @@ -26,8 +25,7 @@ describe('lost-waffle', function() { 'a:nth-child(1n) { float: left; margin-right: 30px;' + ' margin-bottom: 30px; clear: none; }\n' + 'a:last-child { margin-right: 0; margin-bottom: 0; }\n' + - 'a:nth-child(2n) { margin-right: 0; }\n' + - 'a:nth-child(2n) { float: right; }\n' + + 'a:nth-child(2n) { margin-right: 0; float: right; }\n' + 'a:nth-child(2n + 1) { clear: left; }\n' + 'a:nth-last-child(-n + 2) { margin-bottom: 0; }' ); @@ -41,8 +39,7 @@ describe('lost-waffle', function() { 'a:nth-child(1n) { float: left; margin-right: 60px;' + ' margin-bottom: 60px; clear: none; }\n' + 'a:last-child { margin-right: 0; margin-bottom: 0; }\n' + - 'a:nth-child(2n) { margin-right: 0; }\n' + - 'a:nth-child(2n) { float: right; }\n' + + 'a:nth-child(2n) { margin-right: 0; float: right; }\n' + 'a:nth-child(2n + 1) { clear: left; }\n' + 'a:nth-last-child(-n + 2) { margin-bottom: 0; }' ); @@ -55,8 +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; }\n' + - 'a:nth-child(3n) { float: right; }\n' + + 'a:nth-child(3n) { margin-right: 0; float: right; }\n' + 'a:nth-last-child(-n + 3) { margin-bottom: 0; }' ); });