From 0a4a2302fe2b858f6b3036049676ef7505b6d65c Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Sun, 3 Jan 2016 21:30:00 -0800 Subject: [PATCH 01/39] Removes *zoom * Updates lost-center * Updates lost-masonry-wrap * Updates lost-utility --- lib/lost-center.js | 5 ----- lib/lost-masonry-wrap.js | 5 ----- lib/lost-utility.js | 5 ----- test/lost-center.js | 4 ++-- test/lost-masonry-wrap.js | 2 +- test/lost-utility.js | 12 +++++++++--- 6 files changed, 12 insertions(+), 21 deletions(-) diff --git a/lib/lost-center.js b/lib/lost-center.js index c811671c..725e12ac 100644 --- a/lib/lost-center.js +++ b/lib/lost-center.js @@ -61,11 +61,6 @@ module.exports = function lostCenterDecl(css, settings) { }); if (lostCenterFlexbox === 'no-flex') { - decl.cloneBefore({ - prop: '*zoom', - value: '1' - }); - newBlock( decl, ':after', diff --git a/lib/lost-masonry-wrap.js b/lib/lost-masonry-wrap.js index 134e34a0..76cb3709 100644 --- a/lib/lost-masonry-wrap.js +++ b/lib/lost-masonry-wrap.js @@ -66,11 +66,6 @@ module.exports = function lostMasonryWrapDecl(css, settings) { }); if (lostMasonryWrapFlexbox !== 'flex') { - decl.cloneBefore({ - prop: '*zoom', - value: '1' - }); - newBlock( decl, ':after', diff --git a/lib/lost-utility.js b/lib/lost-utility.js index dc8d35df..e4d05a4d 100644 --- a/lib/lost-utility.js +++ b/lib/lost-utility.js @@ -31,11 +31,6 @@ module.exports = function lostUtilityDecl(css, settings) { } if (decl.value == 'clearfix') { - decl.cloneBefore({ - prop: '*zoom', - value: '1' - }); - newBlock( decl, ':after', diff --git a/test/lost-center.js b/test/lost-center.js index f77316ed..10b2c6f4 100644 --- a/test/lost-center.js +++ b/test/lost-center.js @@ -6,7 +6,7 @@ describe('lost-center', function() { it('horizontally centers container', function() { check( 'a { lost-center: 980px }', - 'a { *zoom: 1; max-width: 980px; margin-left: auto; margin-right: auto }\n' + + 'a { max-width: 980px; margin-left: auto; margin-right: auto }\n' + 'a:before { content: \'\'; display: table }\n' + 'a:after { content: \'\'; display: table; clear: both }' ); @@ -15,7 +15,7 @@ describe('lost-center', function() { it('adds 30px padding', function() { check( 'a { lost-center: 980px 30px }', - 'a { *zoom: 1; max-width: 980px; margin-left: auto; margin-right: auto; padding-left: 30px; padding-right: 30px }\n' + + 'a { max-width: 980px; margin-left: auto; margin-right: auto; padding-left: 30px; padding-right: 30px }\n' + 'a:before { content: \'\'; display: table }\n' + 'a:after { content: \'\'; display: table; clear: both }' ); diff --git a/test/lost-masonry-wrap.js b/test/lost-masonry-wrap.js index acaf526c..195e96d4 100644 --- a/test/lost-masonry-wrap.js +++ b/test/lost-masonry-wrap.js @@ -14,7 +14,7 @@ describe('lost-masonry-wrap', function() { it('creates a non-flexbox wrapper', function() { check( 'a { lost-masonry-wrap: no-flex; }', - 'a { *zoom: 1; margin-left: -15px; margin-right: -15px; }\n' + + 'a { margin-left: -15px; margin-right: -15px; }\n' + 'a:before { content: \'\'; display: table; }\n' + 'a:after { content: \'\'; display: table; clear: both; }' ); diff --git a/test/lost-utility.js b/test/lost-utility.js index 37b0d0e6..e0235e6d 100644 --- a/test/lost-utility.js +++ b/test/lost-utility.js @@ -15,9 +15,15 @@ describe('lost-utility', function() { it('applies clearfix', function() { check( 'a { lost-utility: clearfix }', - 'a { *zoom: 1 }\n' + - 'a:before { content: \'\'; display: table }\n' + - 'a:after { content: \'\'; display: table; clear: both }' + 'a:before {\n' + + ' content: \'\';\n' + + ' display: table\n' + + '}\n' + + 'a:after {\n' + + ' content: \'\';\n' + + ' display: table;\n' + + ' clear: both\n' + + '}' ); }); }); From 812bef948b0249c4f7980faa0f5eb073b331a517 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Mon, 25 Jan 2016 21:34:05 -0800 Subject: [PATCH 02/39] Updates the README.md to address #249 and the release of 6.7.0 * Addresses #249 by removing the grid comparison table * Removes 6.7.0 roadmap since it has been released * Removes the transitional note --- README.md | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/README.md b/README.md index ec7ba504..8ee1c753 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,8 @@ Lost Grid is a powerful grid system built in [PostCSS](https://github.com/postcss/postcss) that works with any preprocessor and even vanilla CSS. You can think of it like the [Autoprefixer](https://github.com/postcss/autoprefixer) of grid systems. -## This project is currently transitioning maintainers. - -[@corysimmons](https://github.com/corysimmons) Created this grid and has since moved on to other projects. [@peterramsing](https://github.com/peterramsing), is currently transitioning to maintaining this project. - ### Near Future Roadmap Outline: - [New documentation](https://github.com/peterramsing/lost/milestones/Site%20and%20Docs) to enhance learning and using Lost -- [6.7.0](https://github.com/peterramsing/lost/milestones/6.7.0%20-%20Minor%20Updates) - Some minor updates and fixes. - [7.0.0](https://github.com/peterramsing/lost/milestones/7.0.0) - Looking to fix some issues and enable more ease of use. - A focusing of Lost Grid. With the ever-changing web, Lost wants to be a tool that allows one to dive deep and enable powerful grids, not be the "one tool fits all". With improved documentation and a keen focus, Lost plans on being a great grid option to stand alongside the rest of them. @@ -32,7 +27,6 @@ Lost makes use of [`calc()`](https://webdesign.tutsplus.com/tutorials/calc-grids ## Table of Contents - [Installation](https://github.com/peterramsing/lost/wiki/Installation) -- [Comparison Table](#better-than-x) - [Getting Started](#getting-started) - [Basic Columns](#basic-columns) - [Centering Elements](#centering-elements) @@ -63,37 +57,6 @@ Lost makes use of [`calc()`](https://webdesign.tutsplus.com/tutorials/calc-grids - [Gotchas](#gotchas) - [Thanks](#thanks) - -## General Grid Comparison - -Feature | Lost | [Bootstrap](http://getbootstrap.com/css/#grid) | [Foundation](http://foundation.zurb.com/grid.html) | [Jeet](http://jeet.gs/) | [Neat](http://neat.bourbon.io/) | [Susy](http://susy.oddbird.net/) -:-:|:-:|:-:|:-:|:-:|:-:|:-: -[Responsive](https://github.com/peterramsing/lost/wiki/Comparison-Explanation#responsive) | | | | | | -[Small learning curve](https://github.com/peterramsing/lost/wiki/Comparison-Explanation#small-learning-curve) | | | | | -[Easy-to-implement](https://github.com/peterramsing/lost/wiki/Comparison-Explanation#easy-to-implement) | | | -[Works with Masonry](https://github.com/peterramsing/lost/wiki/Comparison-Explanation#works-with-masonry) | | | | -[Terse markup](https://github.com/peterramsing/lost/wiki/Comparison-Explanation#terse-markup) | | | | | | -[On-the-fly grids](https://github.com/peterramsing/lost/wiki/Comparison-Explanation#on-the-fly-grids) | | | | | | -[Clean markup](https://github.com/peterramsing/lost/wiki/Comparison-Explanation#clean-markup) | | | | | | -[Real gutters](https://github.com/peterramsing/lost/wiki/Comparison-Explanation#real-gutters) | | | | | | -[Sass support](https://github.com/peterramsing/lost/wiki/Comparison-Explanation#sass-support) | | | | | | -[Stylus support](https://github.com/peterramsing/lost/wiki/Comparison-Explanation#stylus-support) | | | | -[LESS support](https://github.com/peterramsing/lost/wiki/Comparison-Explanation#less-support) | | -[CSS support](https://github.com/peterramsing/lost/wiki/Comparison-Explanation#css-support) | | | -[No Additional Ratio Context](https://github.com/peterramsing/lost/wiki/Comparison-Explanation#no-additional-ratio-context) | | | -[Consistent Gutters on All Sides](https://github.com/peterramsing/lost/wiki/Comparison-Explanation#consistent-gutters-on-all-sides) | -[Lightweight](https://github.com/peterramsing/lost/wiki/Comparison-Explanation#lightweight) | -[Vertical Grids](https://github.com/peterramsing/lost/wiki/Comparison-Explanation#vertical-grids) | -[Waffle Grids](https://github.com/peterramsing/lost/wiki/Comparison-Explanation#waffle-grids) | -[Fixed Gutters](https://github.com/peterramsing/lost/wiki/Comparison-Explanation#fixed-gutters) | -[Flexbox Grids](https://github.com/peterramsing/lost/wiki/Comparison-Explanation#flexbox-grids) | | | - -If you notice anything in this table is incorrect, please don't hesitate to [open an issue](https://github.com/peterramsing/lost/issues/new) or [tweet](https://twitter.com/lostgrid) - -**[:arrow_up: back to top](#table-of-contents)** - -  - ### Getting Started Lost Grid rules look like this: From 76dc44cbe3291cba5db8691f3d8d93a6df73efc2 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Mon, 25 Jan 2016 22:01:55 -0800 Subject: [PATCH 03/39] Fixes issue where older Android browsers wouldn't support :nth-child(n) | #153 * Updates tests to reflect this change * Updates the lost-column and lost-waffle to reflect change * Updates documentation to reflect this change --- README.md | 2 +- lib/lost-column.js | 6 +++--- lib/lost-waffle.js | 4 ++-- test/lost-column.js | 12 ++++++------ test/lost-waffle.js | 8 ++++---- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 8ee1c753..9fae83bd 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ And the processed CSS looks like this: div { width: calc(99.99% * 1/3 - (30px - 30px * 1/3)); } -div:nth-child(n) { +div:nth-child(1n) { float: left; margin-right: 30px; clear: none; diff --git a/lib/lost-column.js b/lib/lost-column.js index a583a817..392bcc7c 100644 --- a/lib/lost-column.js +++ b/lib/lost-column.js @@ -127,7 +127,7 @@ module.exports = function lostColumnDecl(css, settings) { newBlock( decl, - ':nth-child(n)', + ':nth-child(1n)', ['margin-right'], [lostColumnGutter] ); @@ -164,7 +164,7 @@ module.exports = function lostColumnDecl(css, settings) { newBlock( decl, - ':nth-child(n)', + ':nth-child(1n)', ['float', 'margin-right', 'clear'], ['left', lostColumnGutter, 'none'] ); @@ -204,7 +204,7 @@ module.exports = function lostColumnDecl(css, settings) { newBlock( decl, - ':nth-child(n)', + ':nth-child(1n)', ['float', 'clear', 'margin-right', 'width'], ['none', 'none', 0, 'auto'] ); diff --git a/lib/lost-waffle.js b/lib/lost-waffle.js index cc5faec9..b6377566 100644 --- a/lib/lost-waffle.js +++ b/lib/lost-waffle.js @@ -132,7 +132,7 @@ module.exports = function lostWaffleDecl(css, settings) { newBlock( decl, - ':nth-child(n)', + ':nth-child(1n)', ['margin-right', 'margin-bottom'], [lostWaffleGutter, lostWaffleGutter] ); @@ -176,7 +176,7 @@ module.exports = function lostWaffleDecl(css, settings) { newBlock( decl, - ':nth-child(n)', + ':nth-child(1n)', ['float', 'margin-right', 'margin-bottom', 'clear'], ['left', lostWaffleGutter, lostWaffleGutter, 'none'] ); diff --git a/test/lost-column.js b/test/lost-column.js index 25c0e1d9..2e99ec75 100644 --- a/test/lost-column.js +++ b/test/lost-column.js @@ -7,7 +7,7 @@ describe('lost-column', function() { check( 'a { lost-column: 1/3; }', 'a { width: calc(99.99% * 1/3 - (30px - 30px * 1/3)); }\n' + - 'a:nth-child(n) { float: left; margin-right: 30px; clear: none; }\n' + + 'a:nth-child(1n) { float: left; margin-right: 30px; clear: none; }\n' + 'a:last-child { margin-right: 0; }\n' + 'a:nth-child(3n) { float: right; }\n' + 'a:nth-child(3n) { margin-right: 0; }\n' + @@ -19,7 +19,7 @@ describe('lost-column', function() { check( 'a { lost-column: 2/5; }', 'a { width: calc(99.99% * 2/5 - (30px - 30px * 2/5)); }\n' + - 'a:nth-child(n) { float: left; margin-right: 30px; clear: none; }\n' + + 'a:nth-child(1n) { float: left; margin-right: 30px; clear: none; }\n' + 'a:last-child { margin-right: 0; }\n' + 'a:nth-child(5n) { float: right; }\n' + 'a:nth-child(5n) { margin-right: 0; }\n' + @@ -31,7 +31,7 @@ describe('lost-column', function() { check( 'a { lost-column: 2/4 2; }', 'a { width: calc(99.99% * 2/4 - (30px - 30px * 2/4)); }\n' + - 'a:nth-child(n) { float: left; margin-right: 30px; clear: none; }\n' + + 'a:nth-child(1n) { float: left; margin-right: 30px; clear: none; }\n' + 'a:last-child { margin-right: 0; }\n' + 'a:nth-child(2n) { float: right; }\n' + 'a:nth-child(2n) { margin-right: 0; }\n' + @@ -43,7 +43,7 @@ describe('lost-column', function() { check( 'a { lost-column: 2/5 3 0; }', 'a { width: calc(99.999999% * 2/5); }\n' + - 'a:nth-child(n) { float: left; margin-right: 0; clear: none; }\n' + + 'a:nth-child(1n) { float: left; margin-right: 0; clear: none; }\n' + 'a:last-child { margin-right: 0; }\n' + 'a:nth-child(3n) { float: right; }\n' + 'a:nth-child(3n) { margin-right: 0; }\n' + @@ -56,7 +56,7 @@ describe('lost-column', function() { 'a { lost-column: 2/6 3 60px flex; }', 'a { flex: 0 0 auto; width: calc(99.99% * 2/6 - (60px - 60px * 2/6));' + ' }\n' + - 'a:nth-child(n) { margin-right: 60px; }\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; }' @@ -67,7 +67,7 @@ describe('lost-column', function() { 'a { lost-column: none; }', 'a { width: auto; }\n' + 'a:last-child { float: none; clear: none; margin-right: 0; width: auto; }\n' + - 'a:nth-child(n) { float: none; clear: none; margin-right: 0; width: auto; }\n' + + 'a:nth-child(1n) { float: none; clear: none; margin-right: 0; width: auto; }\n' + 'a:nth-child(1n + 1) { float: none; clear: none; margin-right: 0; width: auto; }\n' + 'a:nth-child(1n) { float: none; clear: none; margin-right: 0; width: auto; }' ); diff --git a/test/lost-waffle.js b/test/lost-waffle.js index 769dbea4..cbc6430b 100644 --- a/test/lost-waffle.js +++ b/test/lost-waffle.js @@ -8,7 +8,7 @@ describe('lost-waffle', function() { 'a { lost-waffle: 1/3; }', 'a { width: calc(99.99% * 1/3 - (30px - 30px * 1/3));' + ' height: calc(99.99% * 1/3 - (30px - 30px * 1/3)); }\n' + - 'a:nth-child(n) { float: left; margin-right: 30px;' + + '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' + @@ -23,7 +23,7 @@ describe('lost-waffle', function() { 'a { lost-waffle: 2/4 2; }', 'a { width: calc(99.99% * 2/4 - (30px - 30px * 2/4));' + ' height: calc(99.99% * 2/4 - (30px - 30px * 2/4)); }\n' + - 'a:nth-child(n) { float: left; margin-right: 30px;' + + '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' + @@ -38,7 +38,7 @@ describe('lost-waffle', function() { 'a { lost-waffle: 3/6 2 60px; }', 'a { width: calc(99.99% * 3/6 - (60px - 60px * 3/6));' + ' height: calc(99.99% * 3/6 - (60px - 60px * 3/6)); }\n' + - 'a:nth-child(n) { float: left; margin-right: 60px;' + + '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' + @@ -53,7 +53,7 @@ describe('lost-waffle', function() { 'a { lost-waffle: 2/5 3 0 flex; }', 'a { flex: 0 0 auto; width: calc(99.999999% * 2/5);' + ' height: calc(99.999999% * 2/5); }\n' + - 'a:nth-child(n) { margin-right: 0; margin-bottom: 0; }\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' + From 8eb325a053f68836d537c70f99778e36423d8d8c Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Mon, 25 Jan 2016 22:41:36 -0800 Subject: [PATCH 04/39] Updates README.md to reflect a more creator-agnostic wording --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 8ee1c753..4a7b8eff 100644 --- a/README.md +++ b/README.md @@ -765,10 +765,9 @@ div { ### Thanks - [Cory Simmons](https://github.com/corysimmons) for creating this grid! -- [Alex Bass](http://abass.co) for letting me bounce ideas off of him. +- [Alex Bass](http://abass.co) for being available to bounce ideas off of. - [Maria Keller](https://dribbble.com/mariakeller) for the amazing logo. Be sure to hire her for all your design and motion graphic needs. - Everyone who files an [Issue](https://github.com/peterramsing/lost/issues) when something isn't working as expected. -- Everyone who is *actually* interested in my work on grids. **[:arrow_up: back to top](#table-of-contents)** From a6e6e907f2e65d58761ae4b3884fbed3021057df Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Tue, 26 Jan 2016 23:18:48 -0800 Subject: [PATCH 05/39] Fixes broken link in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a7b8eff..99089215 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Lost Grid is a powerful grid system built in [PostCSS](https://github.com/postcs ### Near Future Roadmap Outline: - [New documentation](https://github.com/peterramsing/lost/milestones/Site%20and%20Docs) to enhance learning and using Lost -- [7.0.0](https://github.com/peterramsing/lost/milestones/7.0.0) - Looking to fix some issues and enable more ease of use. +- [7.0.0](https://github.com/peterramsing/lost/milestones/7.0.x) - Looking to fix some issues and enable more ease of use. - A focusing of Lost Grid. With the ever-changing web, Lost wants to be a tool that allows one to dive deep and enable powerful grids, not be the "one tool fits all". With improved documentation and a keen focus, Lost plans on being a great grid option to stand alongside the rest of them. As always, if you have any questions, comments, or concerns please feel free to [open an issue](https://github.com/peterramsing/lost/issues/new). You're also welcome to tweet [@lostgrid](https://twitter.com/lostgrid) if an issue seems too formal. From ba2572bdf5c4830d2ff8b4d2bd2525e076bf6f80 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Wed, 27 Jan 2016 08:00:40 -0800 Subject: [PATCH 06/39] bumbs version to 6.7.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cde78c8d..273a55b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lost", - "version": "6.7.0", + "version": "6.7.1", "description": "PostCSS fractional grid system built with calc() by the guy who built Jeet. Supports masonry, vertical, and waffle grids.", "main": "lost.js", "repository": { From b8597f51a8009feed322f1a23c14240382550e0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Lesiecki?= Date: Tue, 2 Feb 2016 21:10:09 +0100 Subject: [PATCH 07/39] Update README.md Since Less 2.6 you don't need to escape custom at-rules anymore. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 92d52023..b3b4b26b 100644 --- a/README.md +++ b/README.md @@ -738,7 +738,7 @@ div { - If you're using [Less](http://lesscss.org/) there are sometimes issues with fractions being divided before Lost can interpret them. - To fix, escape the math like so: `lost-column: ~"1/2";`. - See: [Lost issue 229](https://github.com/peterramsing/lost/issues/229), [Less issue 974](https://github.com/less/less.js/issues/974) -- If you're using [Less](http://lesscss.org/) you need to escape any `@lost` declarations like so: [See Issue 197](https://github.com/peterramsing/lost/issues/197#issuecomment-170324607) +- If you're using [Less](http://lesscss.org/) in version `<2.6` you need to escape any `@lost` declarations like so: [See Issue 197](https://github.com/peterramsing/lost/issues/197#issuecomment-170324607) ```less .escape-at-rules(@literal) { From 3cf9e27e8284b8cfffdcc458b2b523af577f8331 Mon Sep 17 00:00:00 2001 From: Phil Oxrud Date: Wed, 3 Feb 2016 11:08:36 -0500 Subject: [PATCH 08/39] Fixes lost-column too much code generation --- lib/lost-column.js | 19 ++++++++++--------- test/lost-column.js | 12 ++++-------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/lib/lost-column.js b/lib/lost-column.js index a583a817..3c86fa2c 100644 --- a/lib/lost-column.js +++ b/lib/lost-column.js @@ -131,6 +131,7 @@ module.exports = function lostColumnDecl(css, settings) { ['margin-right'], [lostColumnGutter] ); + } else { if (lostColumnCycle !== 0) { newBlock( @@ -143,18 +144,18 @@ module.exports = function lostColumnDecl(css, settings) { newBlock( decl, ':nth-child('+ lostColumnCycle +'n)', - ['margin-right'], - [0] + ['margin-right', 'float'], + [0, 'right'] + ); + } else { + newBlock( + decl, + ':nth-child('+ lostColumnCycle +'n)', + ['float'], + ['right'] ); } - newBlock( - decl, - ':nth-child('+ lostColumnCycle +'n)', - ['float'], - ['right'] - ); - newBlock( decl, ':last-child', diff --git a/test/lost-column.js b/test/lost-column.js index 25c0e1d9..0aed2630 100644 --- a/test/lost-column.js +++ b/test/lost-column.js @@ -9,8 +9,7 @@ describe('lost-column', function() { 'a { width: calc(99.99% * 1/3 - (30px - 30px * 1/3)); }\n' + 'a:nth-child(n) { float: left; margin-right: 30px; clear: none; }\n' + 'a:last-child { margin-right: 0; }\n' + - 'a:nth-child(3n) { float: right; }\n' + - 'a:nth-child(3n) { margin-right: 0; }\n' + + 'a:nth-child(3n) { margin-right: 0; float: right; }\n' + 'a:nth-child(3n + 1) { clear: left; }' ); }); @@ -21,8 +20,7 @@ describe('lost-column', function() { 'a { width: calc(99.99% * 2/5 - (30px - 30px * 2/5)); }\n' + 'a:nth-child(n) { float: left; margin-right: 30px; clear: none; }\n' + 'a:last-child { margin-right: 0; }\n' + - 'a:nth-child(5n) { float: right; }\n' + - 'a:nth-child(5n) { margin-right: 0; }\n' + + 'a:nth-child(5n) { margin-right: 0; float: right; }\n' + 'a:nth-child(5n + 1) { clear: left; }' ); }); @@ -33,8 +31,7 @@ describe('lost-column', function() { 'a { width: calc(99.99% * 2/4 - (30px - 30px * 2/4)); }\n' + 'a:nth-child(n) { float: left; margin-right: 30px; clear: none; }\n' + 'a:last-child { margin-right: 0; }\n' + - 'a:nth-child(2n) { float: right; }\n' + - 'a:nth-child(2n) { margin-right: 0; }\n' + + 'a:nth-child(2n) { margin-right: 0; float: right; }\n' + 'a:nth-child(2n + 1) { clear: left; }' ); }); @@ -45,8 +42,7 @@ describe('lost-column', function() { 'a { width: calc(99.999999% * 2/5); }\n' + 'a:nth-child(n) { float: left; margin-right: 0; clear: none; }\n' + 'a:last-child { margin-right: 0; }\n' + - 'a:nth-child(3n) { float: right; }\n' + - 'a:nth-child(3n) { margin-right: 0; }\n' + + 'a:nth-child(3n) { margin-right: 0; float: right; }\n' + 'a:nth-child(3n + 1) { clear: left; }' ); }); From 26b9b5b2e512116f7913e141ff9ba7bb91f9c8dd Mon Sep 17 00:00:00 2001 From: Phil Oxrud Date: Thu, 4 Feb 2016 14:47:48 -0500 Subject: [PATCH 09/39] Fixes too much code generation in waffle grids. #256 --- lib/lost-waffle.js | 22 ++++------------------ test/lost-waffle.js | 12 ++++-------- 2 files changed, 8 insertions(+), 26 deletions(-) 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; }' ); }); From 1cb548e79d99d2a6b2b606dc34549d45eddc8924 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Tue, 16 Feb 2016 21:23:33 -0800 Subject: [PATCH 10/39] 6.7.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 273a55b8..6e3322f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lost", - "version": "6.7.1", + "version": "6.7.2", "description": "PostCSS fractional grid system built with calc() by the guy who built Jeet. Supports masonry, vertical, and waffle grids.", "main": "lost.js", "repository": { From f174c0649a8c407f1d60ed9cea8b067a0c3cee48 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Tue, 16 Feb 2016 21:28:08 -0800 Subject: [PATCH 11/39] Updates README.md to reflect new lost-column output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * removes the sourcemap (shouldn’t have been there) * moves the float above the margin --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index b3b4b26b..8cbffe18 100644 --- a/README.md +++ b/README.md @@ -82,14 +82,12 @@ div:last-child { margin-right: 0; } div:nth-child(3n) { - float: right; margin-right: 0; + float: right; } div:nth-child(3n + 1) { clear: left; } - -/*# sourceMappingURL=style.css.map */ ``` **[:arrow_up: back to top](#table-of-contents)** From a0c973a8cd3892fb7948280defa5912b136dc27a Mon Sep 17 00:00:00 2001 From: Aleks Hudochenkov Date: Wed, 17 Feb 2016 11:19:13 +0300 Subject: [PATCH 12/39] Fix 1px rounding issue for flexbox grids in Safari #260 --- lib/lost-column.js | 11 ++--------- lib/lost-waffle.js | 4 ++-- test/lost-column.js | 3 +-- test/lost-waffle.js | 2 +- 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/lib/lost-column.js b/lib/lost-column.js index 1b3ed54f..1bab6315 100644 --- a/lib/lost-column.js +++ b/lib/lost-column.js @@ -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', diff --git a/lib/lost-waffle.js b/lib/lost-waffle.js index 1a4e85cf..1e8f69bd 100644 --- a/lib/lost-waffle.js +++ b/lib/lost-waffle.js @@ -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'] ); } diff --git a/test/lost-column.js b/test/lost-column.js index d272ad8e..7237913b 100644 --- a/test/lost-column.js +++ b/test/lost-column.js @@ -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() { diff --git a/test/lost-waffle.js b/test/lost-waffle.js index fe7f326f..6255fb57 100644 --- a/test/lost-waffle.js +++ b/test/lost-waffle.js @@ -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; }' ); }); From 783312882b5ec0cf47a431636b748e226163e943 Mon Sep 17 00:00:00 2001 From: Aleks Hudochenkov Date: Fri, 19 Feb 2016 10:21:13 +0300 Subject: [PATCH 13/39] Fix issue with `margin-left: auto` and flexbox --- lib/lost-column.js | 4 ++-- lib/lost-waffle.js | 4 ++-- test/lost-column.js | 2 +- test/lost-waffle.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/lost-column.js b/lib/lost-column.js index 1bab6315..3d258ca2 100644 --- a/lib/lost-column.js +++ b/lib/lost-column.js @@ -121,8 +121,8 @@ module.exports = function lostColumnDecl(css, settings) { newBlock( decl, ':nth-child(1n)', - ['margin-right'], - [lostColumnGutter] + ['margin-right', 'margin-left'], + [lostColumnGutter, 0] ); } else { diff --git a/lib/lost-waffle.js b/lib/lost-waffle.js index 1e8f69bd..cb7a10b0 100644 --- a/lib/lost-waffle.js +++ b/lib/lost-waffle.js @@ -126,8 +126,8 @@ module.exports = function lostWaffleDecl(css, settings) { newBlock( decl, ':nth-child(1n)', - ['margin-right', 'margin-bottom'], - [lostWaffleGutter, lostWaffleGutter] + ['margin-right', 'margin-bottom', 'margin-left'], + [lostWaffleGutter, lostWaffleGutter, 0] ); } else { if (lostWaffleCycle !== 0) { diff --git a/test/lost-column.js b/test/lost-column.js index 7237913b..12f811cd 100644 --- a/test/lost-column.js +++ b/test/lost-column.js @@ -52,7 +52,7 @@ describe('lost-column', function() { 'a { lost-column: 2/6 3 60px flex; }', 'a { flex: 0 0 auto; width: calc(99.99% * 2/6 - (60px - 60px * 2/6));' + ' }\n' + - 'a:nth-child(1n) { margin-right: 60px; }\n' + + 'a:nth-child(1n) { margin-right: 60px; margin-left: 0; }\n' + 'a:last-child { margin-right: 0; }\n' + 'a:nth-child(3n) { margin-right: 0; margin-left: auto; }' ); diff --git a/test/lost-waffle.js b/test/lost-waffle.js index 6255fb57..772b6857 100644 --- a/test/lost-waffle.js +++ b/test/lost-waffle.js @@ -50,7 +50,7 @@ describe('lost-waffle', function() { 'a { lost-waffle: 2/5 3 0 flex; }', 'a { flex: 0 0 auto; width: calc(99.999999% * 2/5);' + ' height: calc(99.999999% * 2/5); }\n' + - 'a:nth-child(1n) { margin-right: 0; margin-bottom: 0; }\n' + + 'a:nth-child(1n) { margin-right: 0; margin-bottom: 0; margin-left: 0; }\n' + 'a:last-child { margin-right: 0; margin-bottom: 0; }\n' + 'a:nth-child(3n) { margin-right: 0; margin-left: auto; }\n' + 'a:nth-last-child(-n + 3) { margin-bottom: 0; }' From 608cc576891d0e12370e4f86bd86df764b975619 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Thu, 25 Feb 2016 08:43:17 -0800 Subject: [PATCH 14/39] Adds Waffle.io Badges --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 8cbffe18..3b3ab411 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,17 @@

+

+ [![Stories in Backlog](https://badge.waffle.io/peterramsing/lost.svg?label=status:%20Backlog&title=In%20Backlog)](http://waffle.io/peterramsing/lost) + + [![Stories in Review](https://badge.waffle.io/peterramsing/lost.svg?label=status:%20In%20Review&title=In%20Review)](http://waffle.io/peterramsing/lost) + + [![Stories Ready ](https://badge.waffle.io/peterramsing/lost.svg?label=status:%20Ready%20for%20Dev&title=Ready%20for%20Dev)](http://waffle.io/peterramsing/lost) + + [![Stories in Progress ](https://badge.waffle.io/peterramsing/lost.svg?label=status:%20In%20Progress&title=In%20Progress)](http://waffle.io/peterramsing/lost) + +

+ Lost Grid is a powerful grid system built in [PostCSS](https://github.com/postcss/postcss) that works with any preprocessor and even vanilla CSS. You can think of it like the [Autoprefixer](https://github.com/postcss/autoprefixer) of grid systems. From 927e85d3d9fd8cbe6e7adb8d11f924b5c198ded0 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Thu, 25 Feb 2016 08:44:18 -0800 Subject: [PATCH 15/39] Revert "Adds Waffle.io Badges" This reverts commit 608cc576891d0e12370e4f86bd86df764b975619. --- README.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/README.md b/README.md index 3b3ab411..8cbffe18 100644 --- a/README.md +++ b/README.md @@ -8,17 +8,6 @@

-

- [![Stories in Backlog](https://badge.waffle.io/peterramsing/lost.svg?label=status:%20Backlog&title=In%20Backlog)](http://waffle.io/peterramsing/lost) - - [![Stories in Review](https://badge.waffle.io/peterramsing/lost.svg?label=status:%20In%20Review&title=In%20Review)](http://waffle.io/peterramsing/lost) - - [![Stories Ready ](https://badge.waffle.io/peterramsing/lost.svg?label=status:%20Ready%20for%20Dev&title=Ready%20for%20Dev)](http://waffle.io/peterramsing/lost) - - [![Stories in Progress ](https://badge.waffle.io/peterramsing/lost.svg?label=status:%20In%20Progress&title=In%20Progress)](http://waffle.io/peterramsing/lost) - -

- Lost Grid is a powerful grid system built in [PostCSS](https://github.com/postcss/postcss) that works with any preprocessor and even vanilla CSS. You can think of it like the [Autoprefixer](https://github.com/postcss/autoprefixer) of grid systems. From be242687a7571d43da79f85cf4ca356534126f19 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Sat, 14 May 2016 21:57:49 -0700 Subject: [PATCH 16/39] 6.8.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6e3322f2..a1918a47 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lost", - "version": "6.7.2", + "version": "6.8.0", "description": "PostCSS fractional grid system built with calc() by the guy who built Jeet. Supports masonry, vertical, and waffle grids.", "main": "lost.js", "repository": { From 759543f11f8d5c2b3cb96d3429008948d5413489 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Wed, 18 May 2016 20:13:48 -0700 Subject: [PATCH 17/39] Chore repo updates (#289) Adds .github templates --- .github/ISSUE_TEMPLATE.md | 29 +++++++++++++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 18 ++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..fd3a6351 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,29 @@ +*For support questions you might try tweeting me [@lostgrid](https://twitter.com/lostgrid) first.* + +----- + +**Is this a feature request or a bug report?** + + + +**What is the current behavior?** + + + +**If it's a bug please provide the steps to reproduce it and maybe some code samples.** + + + +**What is the behavior that you expect?** + + + +**What's the motivation or use-case behind changing the behavior?** + + + +**What version of LostGrid, browser and browser version are affected by this issue? Did this happen in previous versions?** + + + +**Anything else?** diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..ae998459 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,18 @@ +**What kind of change is this? (Bug Fix, Feature...)** + + +**What is the current behavior (You can also link to an issue)** + + +**What is the new behavior this introduces (if any)** + + +**Does this introduce any breaking changes?** + + +**Does the PR fulfill the these requirements?** +- [ ] Tests for the changes have been added +- [ ] Docs have been added or updated + + +**Other Comments** From e914b6b4dec562347e474fe604ba51ebb6ae9645 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Sun, 22 May 2016 18:28:07 -0700 Subject: [PATCH 18/39] Removes duplicate line of code for lost-column: none; (#290) There was a duplicate line of code that must have been some copy pasta when I added this. This removes it. --- lib/lost-column.js | 7 ------- test/lost-column.js | 3 +-- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/lost-column.js b/lib/lost-column.js index 3d258ca2..69c1514c 100644 --- a/lib/lost-column.js +++ b/lib/lost-column.js @@ -182,13 +182,6 @@ module.exports = function lostColumnDecl(css, settings) { value: 'auto' }); - newBlock( - decl, - ':nth-child(1n)', - ['float', 'clear', 'margin-right', 'width'], - ['none', 'none', 0, 'auto'] - ); - newBlock( decl, ':nth-child(1n + 1)', diff --git a/test/lost-column.js b/test/lost-column.js index 12f811cd..2f9bbe06 100644 --- a/test/lost-column.js +++ b/test/lost-column.js @@ -63,8 +63,7 @@ describe('lost-column', function() { 'a { width: auto; }\n' + 'a:last-child { float: none; clear: none; margin-right: 0; width: auto; }\n' + 'a:nth-child(1n) { float: none; clear: none; margin-right: 0; width: auto; }\n' + - 'a:nth-child(1n + 1) { float: none; clear: none; margin-right: 0; width: auto; }\n' + - 'a:nth-child(1n) { float: none; clear: none; margin-right: 0; width: auto; }' + 'a:nth-child(1n + 1) { float: none; clear: none; margin-right: 0; width: auto; }' ); }); }); From 5203db934b66da5c317e9b039ba15fff5e929eaa Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Sun, 22 May 2016 22:33:17 -0700 Subject: [PATCH 19/39] Fixes grammar error in PR template. --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ae998459..c06b5c44 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -10,7 +10,7 @@ **Does this introduce any breaking changes?** -**Does the PR fulfill the these requirements?** +**Does the PR fulfill these requirements?** - [ ] Tests for the changes have been added - [ ] Docs have been added or updated From e9893bdb0f31978a577c6b2afa985d3a900a8573 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Sun, 22 May 2016 23:05:51 -0700 Subject: [PATCH 20/39] Minor updates to README --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 8cbffe18..416fd155 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,11 @@

-Lost Grid is a powerful grid system built in [PostCSS](https://github.com/postcss/postcss) that works with any preprocessor and even vanilla CSS. You can think of it like the [Autoprefixer](https://github.com/postcss/autoprefixer) of grid systems. +LostGrid is a powerful grid system built in [PostCSS](https://github.com/postcss/postcss) that works with any preprocessor and even vanilla CSS. You can think of it like the [Autoprefixer](https://github.com/postcss/autoprefixer) of grid systems. ### Near Future Roadmap Outline: - [New documentation](https://github.com/peterramsing/lost/milestones/Site%20and%20Docs) to enhance learning and using Lost -- [7.0.0](https://github.com/peterramsing/lost/milestones/7.0.x) - Looking to fix some issues and enable more ease of use. - A focusing of Lost Grid. With the ever-changing web, Lost wants to be a tool that allows one to dive deep and enable powerful grids, not be the "one tool fits all". With improved documentation and a keen focus, Lost plans on being a great grid option to stand alongside the rest of them. As always, if you have any questions, comments, or concerns please feel free to [open an issue](https://github.com/peterramsing/lost/issues/new). You're also welcome to tweet [@lostgrid](https://twitter.com/lostgrid) if an issue seems too formal. From a91f60b55497df5ea91e9c9c0ef43c4d684768b7 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Mon, 30 May 2016 22:24:50 -0700 Subject: [PATCH 21/39] Updates the "clear" rule from "left" to "both" (#297) * Adds global variable for clearing for fallback. | #276 * If a user would want to use the previous clearing method, this allows this. * Adds support for the new clearing method of "both" to lost-column. | #276 * Resets the globals in tests after lost-column test changes it. * Adds support for the new clearing method of "both" to lost-waffle. | #276 --- README.md | 7 +++++-- lib/lost-at-rule.js | 3 +++ lib/lost-column.js | 22 ++++++++++++++++------ lib/lost-waffle.js | 21 +++++++++++++++------ lost.js | 3 ++- test/lost-column.js | 29 +++++++++++++++++++++++++---- test/lost-waffle.js | 28 +++++++++++++++++++++++++--- 7 files changed, 91 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 416fd155..aac3bd6e 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ div:nth-child(3n) { float: right; } div:nth-child(3n + 1) { - clear: left; + clear: both; } ``` @@ -454,15 +454,18 @@ Lost uses PostCSS which means to override global variables we need to use someth @lost gutter 60px; @lost flexbox flex; @lost cycle none; +@lost clearing left .foo { ... } ``` -- `gutter` accepts any unit value. `30px` by default. +- `gutter` accepts any unit value. `30px` (default). - `flexbox` accepts `flex` or `no-flex` (default). - `cycle` accepts `none` or any digit (although this is really weird). `auto` by default. +- `clearing` accepts `left` or `both` (default). + - See [#276](https://github.com/peterramsing/lost/issues/276) for details **[:arrow_up: back to top](#table-of-contents)** diff --git a/lib/lost-at-rule.js b/lib/lost-at-rule.js index 96bb2861..ea5452b0 100644 --- a/lib/lost-at-rule.js +++ b/lib/lost-at-rule.js @@ -12,6 +12,9 @@ module.exports = function lostAtRule(css, settings) { css.walkAtRules('lost', function(rule) { rule.params = rule.params.split(' '); + if (rule.params[0] == 'clearing') { + settings.clearing = rule.params[1]; + } if (rule.params[0] == 'gutter') { settings.gutter = rule.params[1]; } diff --git a/lib/lost-column.js b/lib/lost-column.js index 69c1514c..b005c88e 100644 --- a/lib/lost-column.js +++ b/lib/lost-column.js @@ -127,12 +127,22 @@ module.exports = function lostColumnDecl(css, settings) { } else { if (lostColumnCycle !== 0) { - newBlock( - decl, - ':nth-child('+ lostColumnCycle +'n + 1)', - ['clear'], - ['left'] - ); + + if (settings.clearing === 'left') { + newBlock( + decl, + ':nth-child('+ lostColumnCycle +'n + 1)', + ['clear'], + ['left'] + ); + } else { + newBlock( + decl, + ':nth-child('+ lostColumnCycle +'n + 1)', + ['clear'], + ['both'] + ); + } newBlock( decl, diff --git a/lib/lost-waffle.js b/lib/lost-waffle.js index cb7a10b0..a821645a 100644 --- a/lib/lost-waffle.js +++ b/lib/lost-waffle.js @@ -138,12 +138,21 @@ module.exports = function lostWaffleDecl(css, settings) { [0] ); - newBlock( - decl, - ':nth-child('+ lostWaffleCycle +'n + 1)', - ['clear'], - ['left'] - ); + if (settings.clearing === 'left') { + newBlock( + decl, + ':nth-child('+ lostWaffleCycle +'n + 1)', + ['clear'], + ['left'] + ); + } else { + newBlock( + decl, + ':nth-child('+ lostWaffleCycle +'n + 1)', + ['clear'], + ['both'] + ); + } newBlock( decl, diff --git a/lost.js b/lost.js index 7bc297f4..6c9b28c3 100644 --- a/lost.js +++ b/lost.js @@ -21,7 +21,8 @@ var libs = [ var defaultSettings = { gutter: '30px', flexbox: 'no-flex', - cycle: 'auto' + cycle: 'auto', + clearing: 'both' }; module.exports = postcss.plugin('lost', function lost(settings) { diff --git a/test/lost-column.js b/test/lost-column.js index 2f9bbe06..4520af86 100644 --- a/test/lost-column.js +++ b/test/lost-column.js @@ -10,7 +10,7 @@ describe('lost-column', function() { 'a:nth-child(1n) { float: left; margin-right: 30px; clear: none; }\n' + 'a:last-child { margin-right: 0; }\n' + 'a:nth-child(3n) { margin-right: 0; float: right; }\n' + - 'a:nth-child(3n + 1) { clear: left; }' + 'a:nth-child(3n + 1) { clear: both; }' ); }); @@ -21,7 +21,7 @@ describe('lost-column', function() { 'a:nth-child(1n) { float: left; margin-right: 30px; clear: none; }\n' + 'a:last-child { margin-right: 0; }\n' + 'a:nth-child(5n) { margin-right: 0; float: right; }\n' + - 'a:nth-child(5n + 1) { clear: left; }' + 'a:nth-child(5n + 1) { clear: both; }' ); }); @@ -32,7 +32,7 @@ describe('lost-column', function() { 'a:nth-child(1n) { float: left; margin-right: 30px; clear: none; }\n' + 'a:last-child { margin-right: 0; }\n' + 'a:nth-child(2n) { margin-right: 0; float: right; }\n' + - 'a:nth-child(2n + 1) { clear: left; }' + 'a:nth-child(2n + 1) { clear: both; }' ); }); @@ -43,7 +43,7 @@ describe('lost-column', function() { 'a:nth-child(1n) { float: left; margin-right: 0; clear: none; }\n' + 'a:last-child { margin-right: 0; }\n' + 'a:nth-child(3n) { margin-right: 0; float: right; }\n' + - 'a:nth-child(3n + 1) { clear: left; }' + 'a:nth-child(3n + 1) { clear: both; }' ); }); @@ -57,6 +57,27 @@ describe('lost-column', function() { 'a:nth-child(3n) { margin-right: 0; margin-left: auto; }' ); }); + + it('supports clearing fallback', function() { + check( + '@lost clearing left; \n' + + 'a { lost-column: 1/3; }', + 'a { width: calc(99.99% * 1/3 - (30px - 30px * 1/3)); }\n' + + 'a:nth-child(1n) { float: left; margin-right: 30px; clear: none; }\n' + + 'a:last-child { margin-right: 0; }\n' + + 'a:nth-child(3n) { margin-right: 0; float: right; }\n' + + 'a:nth-child(3n + 1) { clear: left; }' + ); + }); + + + it('reverts global back to default', function() { + check( + '@lost clearing both', + '' + ); + }); + it('provides none rule', function() { check( 'a { lost-column: none; }', diff --git a/test/lost-waffle.js b/test/lost-waffle.js index 772b6857..71aa21ed 100644 --- a/test/lost-waffle.js +++ b/test/lost-waffle.js @@ -12,7 +12,7 @@ describe('lost-waffle', function() { ' margin-bottom: 30px; clear: none; }\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 + 1) { clear: left; }\n' + + 'a:nth-child(3n + 1) { clear: both; }\n' + 'a:nth-last-child(-n + 3) { margin-bottom: 0; }' ); }); @@ -26,7 +26,7 @@ describe('lost-waffle', function() { ' margin-bottom: 30px; clear: none; }\n' + 'a:last-child { margin-right: 0; margin-bottom: 0; }\n' + 'a:nth-child(2n) { margin-right: 0; float: right; }\n' + - 'a:nth-child(2n + 1) { clear: left; }\n' + + 'a:nth-child(2n + 1) { clear: both; }\n' + 'a:nth-last-child(-n + 2) { margin-bottom: 0; }' ); }); @@ -40,11 +40,33 @@ describe('lost-waffle', function() { ' margin-bottom: 60px; clear: none; }\n' + 'a:last-child { margin-right: 0; margin-bottom: 0; }\n' + 'a:nth-child(2n) { margin-right: 0; float: right; }\n' + - 'a:nth-child(2n + 1) { clear: left; }\n' + + 'a:nth-child(2n + 1) { clear: both; }\n' + 'a:nth-last-child(-n + 2) { margin-bottom: 0; }' ); }); + it('supports clearing fallback', function() { + check( + '@lost clearing left; \n' + + 'a { lost-waffle: 1/3; }', + 'a { width: calc(99.99% * 1/3 - (30px - 30px * 1/3));' + + ' height: calc(99.99% * 1/3 - (30px - 30px * 1/3)); }\n' + + '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; float: right; }\n' + + 'a:nth-child(3n + 1) { clear: left; }\n' + + 'a:nth-last-child(-n + 3) { margin-bottom: 0; }' + ); + }); + + it('reverts global back to default', function() { + check( + '@lost clearing both', + '' + ); + }); + it('supports flexbox', function() { check( 'a { lost-waffle: 2/5 3 0 flex; }', From 8e319bb049b9e9747bbf064d0d46733eb7aa1fe2 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Mon, 30 May 2016 22:27:42 -0700 Subject: [PATCH 22/39] 7.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a1918a47..924fd836 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lost", - "version": "6.8.0", + "version": "7.0.0", "description": "PostCSS fractional grid system built with calc() by the guy who built Jeet. Supports masonry, vertical, and waffle grids.", "main": "lost.js", "repository": { From 7ae225cc2991353dd205127181d3e13e1c7f524b Mon Sep 17 00:00:00 2001 From: Jon Ege Ronnenberg Date: Wed, 1 Jun 2016 05:26:27 +0200 Subject: [PATCH 23/39] change size from 99.99% to 99.9% to avoid rounding errors in Edge and IE (#299) * change size from 99.99% to 99.9% to avoid rounding errors in Microsoft Edge and IE - fixing #295 * update test to pass in the beta branch --- README.md | 2 +- lib/lost-column.js | 4 ++-- lib/lost-masonry-column.js | 2 +- lib/lost-move.js | 4 ++-- lib/lost-offset.js | 8 ++++---- lib/lost-row.js | 2 +- lib/lost-waffle.js | 4 ++-- test/lost-column.js | 12 ++++++------ test/lost-masonry-column.js | 8 ++++---- test/lost-move.js | 10 +++++----- test/lost-offset.js | 10 +++++----- test/lost-row.js | 6 +++--- test/lost-waffle.js | 16 ++++++++-------- 13 files changed, 44 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index aac3bd6e..d3242908 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ And the processed CSS looks like this: ```css div { - width: calc(99.99% * 1/3 - (30px - 30px * 1/3)); + width: calc(99.9% * 1/3 - (30px - 30px * 1/3)); } div:nth-child(1n) { float: left; diff --git a/lib/lost-column.js b/lib/lost-column.js index b005c88e..626afde2 100644 --- a/lib/lost-column.js +++ b/lib/lost-column.js @@ -177,12 +177,12 @@ module.exports = function lostColumnDecl(css, settings) { if (lostColumnGutter !== '0') { decl.cloneBefore({ prop: 'width', - value: 'calc(99.99% * '+ lostColumn +' - ('+ lostColumnGutter +' - '+ lostColumnGutter +' * '+ lostColumn +'))' + value: 'calc(99.9% * '+ lostColumn +' - ('+ lostColumnGutter +' - '+ lostColumnGutter +' * '+ lostColumn +'))' }); } else { decl.cloneBefore({ prop: 'width', - value: 'calc(99.999999% * '+ lostColumn +')' + value: 'calc(99.9% * '+ lostColumn +')' }); } } else { diff --git a/lib/lost-masonry-column.js b/lib/lost-masonry-column.js index a2e1fa04..e75f771f 100644 --- a/lib/lost-masonry-column.js +++ b/lib/lost-masonry-column.js @@ -80,7 +80,7 @@ module.exports = function lostMasonryColumnDecl(css, settings) { if (lostMasonryColumnGutter !== '0') { decl.cloneBefore({ prop: 'width', - value: 'calc(99.99% * '+ lostMasonryColumn +' - '+ lostMasonryColumnGutter +')' + value: 'calc(99.9% * '+ lostMasonryColumn +' - '+ lostMasonryColumnGutter +')' }); decl.cloneBefore({ diff --git a/lib/lost-move.js b/lib/lost-move.js index 4077405f..21ce3dde 100644 --- a/lib/lost-move.js +++ b/lib/lost-move.js @@ -66,7 +66,7 @@ module.exports = function lostMoveDecl(css, settings) { if (lostMoveGutter !== '0') { decl.cloneBefore({ prop: 'top', - value: 'calc(99.99% * '+ lostMove +' - ('+ lostMoveGutter +' - '+ lostMoveGutter +' * '+ lostMove +') + '+ lostMoveGutter +')' + value: 'calc(99.9% * '+ lostMove +' - ('+ lostMoveGutter +' - '+ lostMoveGutter +' * '+ lostMove +') + '+ lostMoveGutter +')' }); } else { decl.cloneBefore({ @@ -78,7 +78,7 @@ module.exports = function lostMoveDecl(css, settings) { if (lostMoveGutter !== '0') { decl.cloneBefore({ prop: 'left', - value: 'calc(99.99% * '+ lostMove +' - ('+ lostMoveGutter +' - '+ lostMoveGutter +' * '+ lostMove +') + '+ lostMoveGutter +')' + value: 'calc(99.9% * '+ lostMove +' - ('+ lostMoveGutter +' - '+ lostMoveGutter +' * '+ lostMove +') + '+ lostMoveGutter +')' }); } else { decl.cloneBefore({ diff --git a/lib/lost-offset.js b/lib/lost-offset.js index 0cd37f19..7dc562fc 100644 --- a/lib/lost-offset.js +++ b/lib/lost-offset.js @@ -62,7 +62,7 @@ module.exports = function lostOffsetDecl(css, settings) { if (lostOffsetGutter !== '0') { decl.cloneBefore({ prop: 'margin-bottom', - value: 'calc(99.99% * '+ lostOffset +' - ('+ lostOffsetGutter +' - '+ lostOffsetGutter +' * '+ lostOffset +') + ('+ lostOffsetGutter +' * 2)) !important' + value: 'calc(99.9% * '+ lostOffset +' - ('+ lostOffsetGutter +' - '+ lostOffsetGutter +' * '+ lostOffset +') + ('+ lostOffsetGutter +' * 2)) !important' }); } else { decl.cloneBefore({ @@ -74,7 +74,7 @@ module.exports = function lostOffsetDecl(css, settings) { if (lostOffsetGutter !== '0') { decl.cloneBefore({ prop: 'margin-top', - value: 'calc(99.99% * ('+ lostOffset +' * -1) - ('+ lostOffsetGutter +' - '+ lostOffsetGutter +' * ('+ lostOffset +' * -1)) + '+ lostOffsetGutter +') !important' + value: 'calc(99.9% * ('+ lostOffset +' * -1) - ('+ lostOffsetGutter +' - '+ lostOffsetGutter +' * ('+ lostOffset +' * -1)) + '+ lostOffsetGutter +') !important' }); } else { decl.cloneBefore({ @@ -98,7 +98,7 @@ module.exports = function lostOffsetDecl(css, settings) { if (lostOffsetGutter !== '0') { decl.cloneBefore({ prop: 'margin-right', - value: 'calc(99.99% * '+ lostOffset +' - ('+ lostOffsetGutter +' - '+ lostOffsetGutter +' * '+ lostOffset +') + ('+ lostOffsetGutter +' * 2)) !important' + value: 'calc(99.9% * '+ lostOffset +' - ('+ lostOffsetGutter +' - '+ lostOffsetGutter +' * '+ lostOffset +') + ('+ lostOffsetGutter +' * 2)) !important' }); } else { decl.cloneBefore({ @@ -110,7 +110,7 @@ module.exports = function lostOffsetDecl(css, settings) { if (lostOffsetGutter !== '0') { decl.cloneBefore({ prop: 'margin-left', - value: 'calc(99.99% * ('+ lostOffset +' * -1) - ('+ lostOffsetGutter +' - '+ lostOffsetGutter +' * ('+ lostOffset +' * -1)) + '+ lostOffsetGutter +') !important' + value: 'calc(99.9% * ('+ lostOffset +' * -1) - ('+ lostOffsetGutter +' - '+ lostOffsetGutter +' * ('+ lostOffset +' * -1)) + '+ lostOffsetGutter +') !important' }); } else { decl.cloneBefore({ diff --git a/lib/lost-row.js b/lib/lost-row.js index f8944901..d28f24ac 100644 --- a/lib/lost-row.js +++ b/lib/lost-row.js @@ -79,7 +79,7 @@ module.exports = function lostRowDecl(css, settings) { if (lostRowGutter !== '0') { decl.cloneBefore({ prop: 'height', - value: 'calc(99.99% * '+ lostRow +' - ('+ lostRowGutter +' - '+ lostRowGutter +' * '+ lostRow +'))' + value: 'calc(99.9% * '+ lostRow +' - ('+ lostRowGutter +' - '+ lostRowGutter +' * '+ lostRow +'))' }); } else { decl.cloneBefore({ diff --git a/lib/lost-waffle.js b/lib/lost-waffle.js index a821645a..b4483bca 100644 --- a/lib/lost-waffle.js +++ b/lib/lost-waffle.js @@ -180,12 +180,12 @@ module.exports = function lostWaffleDecl(css, settings) { if (lostWaffleGutter !== '0') { decl.cloneBefore({ prop: 'width', - value: 'calc(99.99% * '+ lostWaffle +' - ('+ lostWaffleGutter +' - '+ lostWaffleGutter +' * '+ lostWaffle +'))' + value: 'calc(99.9% * '+ lostWaffle +' - ('+ lostWaffleGutter +' - '+ lostWaffleGutter +' * '+ lostWaffle +'))' }); decl.cloneBefore({ prop: 'height', - value: 'calc(99.99% * '+ lostWaffle +' - ('+ lostWaffleGutter +' - '+ lostWaffleGutter +' * '+ lostWaffle +'))' + value: 'calc(99.9% * '+ lostWaffle +' - ('+ lostWaffleGutter +' - '+ lostWaffleGutter +' * '+ lostWaffle +'))' }); } else { decl.cloneBefore({ diff --git a/test/lost-column.js b/test/lost-column.js index 4520af86..af7ed4fe 100644 --- a/test/lost-column.js +++ b/test/lost-column.js @@ -6,7 +6,7 @@ describe('lost-column', function() { it('provides 3 column layout', function() { check( 'a { lost-column: 1/3; }', - 'a { width: calc(99.99% * 1/3 - (30px - 30px * 1/3)); }\n' + + 'a { width: calc(99.9% * 1/3 - (30px - 30px * 1/3)); }\n' + 'a:nth-child(1n) { float: left; margin-right: 30px; clear: none; }\n' + 'a:last-child { margin-right: 0; }\n' + 'a:nth-child(3n) { margin-right: 0; float: right; }\n' + @@ -17,7 +17,7 @@ describe('lost-column', function() { it('provides 2/5 column layout', function() { check( 'a { lost-column: 2/5; }', - 'a { width: calc(99.99% * 2/5 - (30px - 30px * 2/5)); }\n' + + 'a { width: calc(99.9% * 2/5 - (30px - 30px * 2/5)); }\n' + 'a:nth-child(1n) { float: left; margin-right: 30px; clear: none; }\n' + 'a:last-child { margin-right: 0; }\n' + 'a:nth-child(5n) { margin-right: 0; float: right; }\n' + @@ -28,7 +28,7 @@ describe('lost-column', function() { it('can support custom cycle', function() { check( 'a { lost-column: 2/4 2; }', - 'a { width: calc(99.99% * 2/4 - (30px - 30px * 2/4)); }\n' + + 'a { width: calc(99.9% * 2/4 - (30px - 30px * 2/4)); }\n' + 'a:nth-child(1n) { float: left; margin-right: 30px; clear: none; }\n' + 'a:last-child { margin-right: 0; }\n' + 'a:nth-child(2n) { margin-right: 0; float: right; }\n' + @@ -39,7 +39,7 @@ describe('lost-column', function() { it('supports no gutter', function() { check( 'a { lost-column: 2/5 3 0; }', - 'a { width: calc(99.999999% * 2/5); }\n' + + 'a { width: calc(99.9% * 2/5); }\n' + 'a:nth-child(1n) { float: left; margin-right: 0; clear: none; }\n' + 'a:last-child { margin-right: 0; }\n' + 'a:nth-child(3n) { margin-right: 0; float: right; }\n' + @@ -50,7 +50,7 @@ describe('lost-column', function() { it('supports flexbox', function() { check( 'a { lost-column: 2/6 3 60px flex; }', - 'a { flex: 0 0 auto; width: calc(99.99% * 2/6 - (60px - 60px * 2/6));' + + 'a { flex: 0 0 auto; width: calc(99.9% * 2/6 - (60px - 60px * 2/6));' + ' }\n' + 'a:nth-child(1n) { margin-right: 60px; margin-left: 0; }\n' + 'a:last-child { margin-right: 0; }\n' + @@ -62,7 +62,7 @@ describe('lost-column', function() { check( '@lost clearing left; \n' + 'a { lost-column: 1/3; }', - 'a { width: calc(99.99% * 1/3 - (30px - 30px * 1/3)); }\n' + + 'a { width: calc(99.9% * 1/3 - (30px - 30px * 1/3)); }\n' + 'a:nth-child(1n) { float: left; margin-right: 30px; clear: none; }\n' + 'a:last-child { margin-right: 0; }\n' + 'a:nth-child(3n) { margin-right: 0; float: right; }\n' + diff --git a/test/lost-masonry-column.js b/test/lost-masonry-column.js index b3cf22ca..70e34b7c 100644 --- a/test/lost-masonry-column.js +++ b/test/lost-masonry-column.js @@ -6,7 +6,7 @@ describe('lost-masonry-column', function() { it('supports a custom gutter', function() { check( 'a { lost-masonry-column: 60px; }', - 'a { float: left; width: calc(99.99% * 60px - 30px); margin-left: 15px;' + + 'a { float: left; width: calc(99.9% * 60px - 30px); margin-left: 15px;' + ' margin-right: 15px; }' ); }); @@ -14,7 +14,7 @@ describe('lost-masonry-column', function() { it('supports no gutter', function() { check( 'a { lost-masonry-column: 0; }', - 'a { float: left; width: calc(99.99% * 0 - 30px); margin-left: 15px;' + + 'a { float: left; width: calc(99.9% * 0 - 30px); margin-left: 15px;' + ' margin-right: 15px; }' ); }); @@ -23,7 +23,7 @@ describe('lost-masonry-column', function() { it('supports a custom gutter', function() { check( 'a { lost-masonry-column: 60px flex; }', - 'a { flex: 0 0 auto; width: calc(99.99% * 60px - 30px);' + + 'a { flex: 0 0 auto; width: calc(99.9% * 60px - 30px);' + ' margin-left: 15px; margin-right: 15px; }' ); }); @@ -31,7 +31,7 @@ describe('lost-masonry-column', function() { it('supports no gutter', function() { check( 'a { lost-masonry-column: 0 flex; }', - 'a { flex: 0 0 auto; width: calc(99.99% * 0 - 30px);' + + 'a { flex: 0 0 auto; width: calc(99.9% * 0 - 30px);' + ' margin-left: 15px; margin-right: 15px; }' ); }); diff --git a/test/lost-move.js b/test/lost-move.js index 896c1504..e1c6267f 100644 --- a/test/lost-move.js +++ b/test/lost-move.js @@ -6,7 +6,7 @@ describe('lost-move', function() { it('moves element to the left', function() { check( 'a { lost-move: 1/3; }', - 'a { position: relative; left: calc(99.99% * 1/3 - (30px - 30px * 1/3)' + + 'a { position: relative; left: calc(99.9% * 1/3 - (30px - 30px * 1/3)' + ' + 30px); }' ); }); @@ -14,7 +14,7 @@ describe('lost-move', function() { it('moves element to the right', function() { check( 'a { lost-move: -1/3; }', - 'a { position: relative; left: calc(99.99% * -1/3 -' + + 'a { position: relative; left: calc(99.9% * -1/3 -' + ' (30px - 30px * -1/3) + 30px); }' ); }); @@ -22,7 +22,7 @@ describe('lost-move', function() { it('moves element up', function() { check( 'a { lost-move: 1/3 column; }', - 'a { position: relative; top: calc(99.99% * 1/3 - (30px - 30px * 1/3)' + + 'a { position: relative; top: calc(99.9% * 1/3 - (30px - 30px * 1/3)' + ' + 30px); }' ); }); @@ -30,7 +30,7 @@ describe('lost-move', function() { it('moves element down', function() { check( 'a { lost-move: -1/3 column; }', - 'a { position: relative; top: calc(99.99% * -1/3 - (30px - 30px * -1/3)' + + 'a { position: relative; top: calc(99.9% * -1/3 - (30px - 30px * -1/3)' + ' + 30px); }' ); }); @@ -38,7 +38,7 @@ describe('lost-move', function() { it('supports custom gutter', function() { check( 'a { lost-move: 1/2 row 60px; }', - 'a { position: relative; left: calc(99.99% * 1/2 - (60px - 60px * 1/2)' + + 'a { position: relative; left: calc(99.9% * 1/2 - (60px - 60px * 1/2)' + ' + 60px); }' ); }); diff --git a/test/lost-offset.js b/test/lost-offset.js index 2d6c5274..2c8c9255 100644 --- a/test/lost-offset.js +++ b/test/lost-offset.js @@ -6,7 +6,7 @@ describe('lost-offset', function() { it('moves element to the left', function() { check( 'a { lost-offset: 1/3; }', - 'a { margin-right: calc(99.99% * 1/3 - (30px - 30px * 1/3) + (30px * 2)' + + 'a { margin-right: calc(99.9% * 1/3 - (30px - 30px * 1/3) + (30px * 2)' + ') !important; }' ); }); @@ -14,7 +14,7 @@ describe('lost-offset', function() { it('moves element to the right', function() { check( 'a { lost-offset: -1/3; }', - 'a { margin-left: calc(99.99% * (-1/3 * -1) - (30px - 30px * ' + + 'a { margin-left: calc(99.9% * (-1/3 * -1) - (30px - 30px * ' + '(-1/3 * -1)) + 30px) !important; }' ); }); @@ -22,7 +22,7 @@ describe('lost-offset', function() { it('moves element up', function() { check( 'a { lost-offset: 1/3 column; }', - 'a { margin-bottom: calc(99.99% * 1/3 - (30px - 30px * 1/3) + ' + + 'a { margin-bottom: calc(99.9% * 1/3 - (30px - 30px * 1/3) + ' + '(30px * 2)) !important; }' ); }); @@ -30,7 +30,7 @@ describe('lost-offset', function() { it('moves element down', function() { check( 'a { lost-offset: -1/3 column; }', - 'a { margin-top: calc(99.99% * (-1/3 * -1) - (30px - 30px * ' + + 'a { margin-top: calc(99.9% * (-1/3 * -1) - (30px - 30px * ' + '(-1/3 * -1)) + 30px) !important; }' ); }); @@ -38,7 +38,7 @@ describe('lost-offset', function() { it('supports custom gutter', function() { check( 'a { lost-offset: 1/2 row 60px; }', - 'a { margin-right: calc(99.99% * 1/2 - (60px - 60px * 1/2) + ' + + 'a { margin-right: calc(99.9% * 1/2 - (60px - 60px * 1/2) + ' + '(60px * 2)) !important; }' ); }); diff --git a/test/lost-row.js b/test/lost-row.js index fac81441..7c28bd06 100644 --- a/test/lost-row.js +++ b/test/lost-row.js @@ -6,7 +6,7 @@ describe('lost-row', function() { it('provides 3 row layout', function() { check( 'a { lost-row: 1/3; }', - 'a { width: 100%; height: calc(99.99% * 1/3 - (30px - 30px * 1/3));' + + 'a { width: 100%; height: calc(99.9% * 1/3 - (30px - 30px * 1/3));' + ' margin-bottom: 30px; }\n' + 'a:last-child { margin-bottom: 0; }' ); @@ -15,7 +15,7 @@ describe('lost-row', function() { it('provides 2/5 row layout', function() { check( 'a { lost-row: 2/5; }', - 'a { width: 100%; height: calc(99.99% * 2/5 - (30px - 30px * 2/5));' + + 'a { width: 100%; height: calc(99.9% * 2/5 - (30px - 30px * 2/5));' + ' margin-bottom: 30px; }\n' + 'a:last-child { margin-bottom: 0; }' ); @@ -33,7 +33,7 @@ describe('lost-row', function() { check( 'a { lost-row: 2/6 60px flex; }', 'a { width: 100%; flex: 0 0 auto;' + - ' height: calc(99.99% * 2/6 - (60px - 60px * 2/6));' + + ' height: calc(99.9% * 2/6 - (60px - 60px * 2/6));' + ' margin-bottom: 60px; }\n' + 'a:last-child { margin-bottom: 0; }' ); diff --git a/test/lost-waffle.js b/test/lost-waffle.js index 71aa21ed..bc7225ee 100644 --- a/test/lost-waffle.js +++ b/test/lost-waffle.js @@ -6,8 +6,8 @@ describe('lost-waffle', function() { it('provides 3 column layout', function() { check( 'a { lost-waffle: 1/3; }', - 'a { width: calc(99.99% * 1/3 - (30px - 30px * 1/3));' + - ' height: calc(99.99% * 1/3 - (30px - 30px * 1/3)); }\n' + + 'a { width: calc(99.9% * 1/3 - (30px - 30px * 1/3));' + + ' height: calc(99.9% * 1/3 - (30px - 30px * 1/3)); }\n' + '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' + @@ -20,8 +20,8 @@ describe('lost-waffle', function() { it('supports a custom cycle', function() { check( 'a { lost-waffle: 2/4 2; }', - 'a { width: calc(99.99% * 2/4 - (30px - 30px * 2/4));' + - ' height: calc(99.99% * 2/4 - (30px - 30px * 2/4)); }\n' + + 'a { width: calc(99.9% * 2/4 - (30px - 30px * 2/4));' + + ' height: calc(99.9% * 2/4 - (30px - 30px * 2/4)); }\n' + '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' + @@ -34,8 +34,8 @@ describe('lost-waffle', function() { it('supports a custom gutter', function() { check( 'a { lost-waffle: 3/6 2 60px; }', - 'a { width: calc(99.99% * 3/6 - (60px - 60px * 3/6));' + - ' height: calc(99.99% * 3/6 - (60px - 60px * 3/6)); }\n' + + 'a { width: calc(99.9% * 3/6 - (60px - 60px * 3/6));' + + ' height: calc(99.9% * 3/6 - (60px - 60px * 3/6)); }\n' + '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' + @@ -49,8 +49,8 @@ describe('lost-waffle', function() { check( '@lost clearing left; \n' + 'a { lost-waffle: 1/3; }', - 'a { width: calc(99.99% * 1/3 - (30px - 30px * 1/3));' + - ' height: calc(99.99% * 1/3 - (30px - 30px * 1/3)); }\n' + + 'a { width: calc(99.9% * 1/3 - (30px - 30px * 1/3));' + + ' height: calc(99.9% * 1/3 - (30px - 30px * 1/3)); }\n' + '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' + From c7369c2f7bbc00da8906b54ac250320d5b518e89 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Tue, 31 May 2016 21:10:57 -0700 Subject: [PATCH 24/39] 7.0.1-0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 924fd836..da9e78fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lost", - "version": "7.0.0", + "version": "7.0.1-0", "description": "PostCSS fractional grid system built with calc() by the guy who built Jeet. Supports masonry, vertical, and waffle grids.", "main": "lost.js", "repository": { From 27a7b5d4359c350d831fcb62aac9b173805ae5e6 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Sat, 4 Jun 2016 07:29:58 -0700 Subject: [PATCH 25/39] Adds the gutter badge (instead of #300) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 416fd155..723e8718 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ +

LostGrid is a powerful grid system built in [PostCSS](https://github.com/postcss/postcss) that works with any preprocessor and even vanilla CSS. You can think of it like the [Autoprefixer](https://github.com/postcss/autoprefixer) of grid systems. From cf0909b8d51d028c4d5cbbac40f7fa0e17490917 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Sat, 4 Jun 2016 07:46:28 -0700 Subject: [PATCH 26/39] adds the correct gitter status badge - whoops --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 723e8718..a2b24f26 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ - +

LostGrid is a powerful grid system built in [PostCSS](https://github.com/postcss/postcss) that works with any preprocessor and even vanilla CSS. You can think of it like the [Autoprefixer](https://github.com/postcss/autoprefixer) of grid systems. From 0f8d36eebcbd5cc49ccf8fe113438d8e88da6521 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Sat, 4 Jun 2016 15:22:30 -0700 Subject: [PATCH 27/39] merge beta --- lib/lost-masonry-column.js | 4 ++-- lib/lost-waffle.js | 8 ++++---- test/lost-waffle.js | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/lost-masonry-column.js b/lib/lost-masonry-column.js index c4d5b83a..b27fe418 100644 --- a/lib/lost-masonry-column.js +++ b/lib/lost-masonry-column.js @@ -88,7 +88,7 @@ module.exports = function lostMasonryColumnDecl(css, settings) { if (lostMasonryColumnGutter !== '0') { cloneAllBefore({ - 'width': 'calc(99.99% * '+ lostMasonryColumn +' - '+ lostMasonryColumnGutter +')', + 'width': 'calc(99.9% * '+ lostMasonryColumn +' - '+ lostMasonryColumnGutter +')', 'margin-left': (parseInt(lostMasonryColumnGutter) / 2) + lostMasonryColumnGutterUnit, 'margin-right': (parseInt(lostMasonryColumnGutter) / 2) + lostMasonryColumnGutterUnit }); @@ -96,7 +96,7 @@ module.exports = function lostMasonryColumnDecl(css, settings) { } else { cloneAllBefore({ - 'width': 'calc(99.999999% * '+ lostMasonryColumn +')', + 'width': 'calc(99.9% * '+ lostMasonryColumn +')', 'margin-left': (parseInt(lostMasonryColumnGutter) / 2) + lostMasonryColumnGutterUnit, 'margin-right': (parseInt(lostMasonryColumnGutter) / 2) + lostMasonryColumnGutterUnit }); diff --git a/lib/lost-waffle.js b/lib/lost-waffle.js index 08099fd2..e9745acb 100644 --- a/lib/lost-waffle.js +++ b/lib/lost-waffle.js @@ -188,13 +188,13 @@ module.exports = function lostWaffleDecl(css, settings) { if (lostWaffleGutter !== '0') { cloneAllBefore({ - 'width': 'calc(99.99% * '+ lostWaffle +' - ('+ lostWaffleGutter +' - '+ lostWaffleGutter +' * '+ lostWaffle +'))', - 'height': 'calc(99.99% * '+ lostWaffle +' - ('+ lostWaffleGutter +' - '+ lostWaffleGutter +' * '+ lostWaffle +'))' + 'width': 'calc(99.9% * '+ lostWaffle +' - ('+ lostWaffleGutter +' - '+ lostWaffleGutter +' * '+ lostWaffle +'))', + 'height': 'calc(99.9% * '+ lostWaffle +' - ('+ lostWaffleGutter +' - '+ lostWaffleGutter +' * '+ lostWaffle +'))' }); } else { cloneAllBefore({ - 'width': 'calc(99.999999% * '+ lostWaffle +')', - 'height': 'calc(99.999999% * '+ lostWaffle +')' + 'width': 'calc(99.9% * '+ lostWaffle +')', + 'height': 'calc(99.9% * '+ lostWaffle +')' }); } diff --git a/test/lost-waffle.js b/test/lost-waffle.js index bc7225ee..ab10a6e4 100644 --- a/test/lost-waffle.js +++ b/test/lost-waffle.js @@ -70,8 +70,8 @@ describe('lost-waffle', function() { it('supports flexbox', function() { check( 'a { lost-waffle: 2/5 3 0 flex; }', - 'a { flex: 0 0 auto; width: calc(99.999999% * 2/5);' + - ' height: calc(99.999999% * 2/5); }\n' + + 'a { flex: 0 0 auto; width: calc(99.9% * 2/5);' + + ' height: calc(99.9% * 2/5); }\n' + 'a:nth-child(1n) { margin-right: 0; margin-bottom: 0; margin-left: 0; }\n' + 'a:last-child { margin-right: 0; margin-bottom: 0; }\n' + 'a:nth-child(3n) { margin-right: 0; margin-left: auto; }\n' + From f2dffdfa7171bcfbf51173834abe86c009d54ca2 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Sat, 4 Jun 2016 15:25:40 -0700 Subject: [PATCH 28/39] Adds lost-row: none rule (#306) * Initial implementation of lost-row: none rule | #263 * Minor update for documentation of lost-row: none; rule | #263 --- README.md | 1 + lib/lost-row.js | 113 +++++++++++++++++++++++++++-------------------- test/lost-row.js | 10 ++++- 3 files changed, 76 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index f39745a3..1aae6f98 100644 --- a/README.md +++ b/README.md @@ -583,6 +583,7 @@ Creates a row that is a fraction of the size of its containing element's height - `fraction` - This is a simple fraction of the containing element's height. - `gutter` - The margin on the bottom of the element used to create a gutter. Typically this is left alone and settings.gutter will be used, but you can override it here if you want certain elements to have a particularly large or small gutter (pass 0 for no gutter at all). - `flex|no-flex` - Determines whether this element should use Flexbox or not. +- `none` - Resets the row (back to browser defaults) ```css section { diff --git a/lib/lost-row.js b/lib/lost-row.js index d28f24ac..13b66ec0 100644 --- a/lib/lost-row.js +++ b/lib/lost-row.js @@ -31,74 +31,93 @@ module.exports = function lostRowDecl(css, settings) { lostRowGutter = settings.gutter, lostRowFlexbox = settings.flexbox; - declArr = decl.value.split(' '); - lostRow = declArr[0]; + if (decl.value !== 'none') { + declArr = decl.value.split(' '); + lostRow = declArr[0]; - if (declArr[1] !== undefined && declArr[1].search(/^\d/) !== -1) { - lostRowGutter = declArr[1]; - } + if (declArr[1] !== undefined && declArr[1].search(/^\d/) !== -1) { + lostRowGutter = declArr[1]; + } - if (declArr.indexOf('flex') !== -1) { - lostRowFlexbox = 'flex'; - } + if (declArr.indexOf('flex') !== -1) { + lostRowFlexbox = 'flex'; + } - if (declArr.indexOf('no-flex') !== -1) { - lostRowFlexbox = 'no-flex'; - } + if (declArr.indexOf('no-flex') !== -1) { + lostRowFlexbox = 'no-flex'; + } - decl.parent.nodes.forEach(function (decl) { - if (decl.prop == 'lost-row-gutter') { - lostRowGutter = decl.value; + decl.parent.nodes.forEach(function (decl) { + if (decl.prop == 'lost-row-gutter') { + lostRowGutter = decl.value; - decl.remove(); - } - }); + decl.remove(); + } + }); - decl.parent.nodes.forEach(function (decl) { - if (decl.prop == 'lost-row-flexbox') { - if (decl.prop == 'flex') { - lostRowFlexbox = 'flex'; + decl.parent.nodes.forEach(function (decl) { + if (decl.prop == 'lost-row-flexbox') { + if (decl.prop == 'flex') { + lostRowFlexbox = 'flex'; + } + + decl.remove(); } + }); + + decl.cloneBefore({ + prop: 'width', + value: '100%' + }); - decl.remove(); + if (lostRowFlexbox === 'flex') { + decl.cloneBefore({ + prop: 'flex', + value: '0 0 auto' + }); } - }); - decl.cloneBefore({ - prop: 'width', - value: '100%' - }); + if (lostRowGutter !== '0') { + decl.cloneBefore({ + prop: 'height', + value: 'calc(99.9% * '+ lostRow +' - ('+ lostRowGutter +' - '+ lostRowGutter +' * '+ lostRow +'))' + }); + } else { + decl.cloneBefore({ + prop: 'height', + value: 'calc(99.9% * '+ lostRow +')' + }); + } - if (lostRowFlexbox === 'flex') { decl.cloneBefore({ - prop: 'flex', - value: '0 0 auto' + prop: 'margin-bottom', + value: lostRowGutter }); - } - if (lostRowGutter !== '0') { + newBlock( + decl, + ':last-child', + ['margin-bottom'], + [0] + ); + } else { decl.cloneBefore({ - prop: 'height', - value: 'calc(99.9% * '+ lostRow +' - ('+ lostRowGutter +' - '+ lostRowGutter +' * '+ lostRow +'))' + prop: 'width', + value: 'auto' }); - } else { + decl.cloneBefore({ prop: 'height', - value: 'calc(99.999999% * '+ lostRow +')' + value: 'auto' + }); + + decl.cloneBefore({ + prop: 'margin-bottom', + value: '0' }); } - decl.cloneBefore({ - prop: 'margin-bottom', - value: lostRowGutter - }); - - newBlock( - decl, - ':last-child', - ['margin-bottom'], - [0] - ); + decl.remove(); }); diff --git a/test/lost-row.js b/test/lost-row.js index 7c28bd06..cd4ace06 100644 --- a/test/lost-row.js +++ b/test/lost-row.js @@ -24,7 +24,7 @@ describe('lost-row', function() { it('supports no gutter', function() { check( 'a { lost-row: 2/5 0; }', - 'a { width: 100%; height: calc(99.999999% * 2/5); margin-bottom: 0; }\n' + + 'a { width: 100%; height: calc(99.9% * 2/5); margin-bottom: 0; }\n' + 'a:last-child { margin-bottom: 0; }' ); }); @@ -38,4 +38,12 @@ describe('lost-row', function() { 'a:last-child { margin-bottom: 0; }' ); }); + + it('provides none rule', function() { + check( + 'a { lost-row: none; }', + 'a { width: auto; height: auto;' + + ' margin-bottom: 0; }' + ); + }); }); From 454830af4265ce60082bb01bfb1f82096be4484b Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Sat, 4 Jun 2016 15:45:27 -0700 Subject: [PATCH 29/39] bumps version for beta release - jumps to 2 to stay in sync with GitHub releases --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index da9e78fc..fac996d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lost", - "version": "7.0.1-0", + "version": "7.0.1-2", "description": "PostCSS fractional grid system built with calc() by the guy who built Jeet. Supports masonry, vertical, and waffle grids.", "main": "lost.js", "repository": { From e67027ed98e5ef088c8a9706d02c3b02f0be6add Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Wed, 8 Jun 2016 19:28:25 -0700 Subject: [PATCH 30/39] Bumps version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a1918a47..4e412a20 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lost", - "version": "6.8.0", + "version": "6.8.1", "description": "PostCSS fractional grid system built with calc() by the guy who built Jeet. Supports masonry, vertical, and waffle grids.", "main": "lost.js", "repository": { From 20f55d456facf70709539dc866ad3974f280319f Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Tue, 14 Jun 2016 23:28:56 -0700 Subject: [PATCH 31/39] Updates the License No Breaking Changes. This simply updates the year and adds other developers to license. --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index e8623721..be2184f4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Cory Simmons +Copyright (c) 2016 Cory Simmons, Peter Ramsing, and LostGrid Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 63cb862d654d9b4731dfe78afb01f411f5fe6b53 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Fri, 1 Jul 2016 22:59:44 -0700 Subject: [PATCH 32/39] Bumps version to beta 3 for NPM testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For some reason I can't get NPM to download the beta changes. I'm not sure what is causing this so I'm bumping the version and publishing a new beta to ensure the latest changes are in. 👍 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fac996d7..ea6ec88b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lost", - "version": "7.0.1-2", + "version": "7.0.1-3", "description": "PostCSS fractional grid system built with calc() by the guy who built Jeet. Supports masonry, vertical, and waffle grids.", "main": "lost.js", "repository": { From ac1abba6b6b85de73bdb6f37eab3b94dd15909c3 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Fri, 1 Jul 2016 23:09:05 -0700 Subject: [PATCH 33/39] Adds inline docs for lost-row: none --- lib/lost-row.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/lost-row.js b/lib/lost-row.js index 13b66ec0..81fef470 100644 --- a/lib/lost-row.js +++ b/lib/lost-row.js @@ -16,6 +16,8 @@ var newBlock = require('./new-block.js'); * @param {string} [flex|no-flex] - Determines whether this element should * use Flexbox or not. * + * @param {string} [none] - Resets to a standard browser default. + * * @example * section { * height: 100%; From e5c956820c9134714df1d8120e272a48e09c20c4 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Fri, 1 Jul 2016 23:14:37 -0700 Subject: [PATCH 34/39] Updates the author and homepage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I think it's probably time I add myself as an author along with update the homepage. 👍 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ea6ec88b..1e7ffaec 100644 --- a/package.json +++ b/package.json @@ -16,12 +16,12 @@ "fraction", "ratio" ], - "author": "Cory Simmons", + "author": "Cory Simmons & Peter Ramsing (http://peter.coffee)", "license": "MIT", "bugs": { "url": "https://github.com/peterramsing/lost/issues" }, - "homepage": "https://github.com/peterramsing/lost", + "homepage": "http://lostgrid.org", "devDependencies": { "chai": "^3.0.0", "coveralls": "^2.11.2", From 1cae660c128025a399c73b7b65a30425b5fa6cff Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Fri, 1 Jul 2016 23:16:11 -0700 Subject: [PATCH 35/39] bumps version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1e7ffaec..b95ec584 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lost", - "version": "7.0.1-3", + "version": "7.0.1", "description": "PostCSS fractional grid system built with calc() by the guy who built Jeet. Supports masonry, vertical, and waffle grids.", "main": "lost.js", "repository": { From 729360a88b73e505c0fb2c1cd5c44a0cff896d9a Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Mon, 4 Jul 2016 10:04:39 -0700 Subject: [PATCH 36/39] Fixes image linking to old url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1aae6f98..d49c7ef4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- +

From 1c74187723bd35c5520d92bf94801a7d691b7993 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Tue, 5 Jul 2016 17:57:06 -0400 Subject: [PATCH 37/39] Stop modifying default settings between builds This does not only affect tests. This also makes a difference when building multiple postcss targets in sequence. --- lost.js | 2 +- test/lost-global-settings.js | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 test/lost-global-settings.js diff --git a/lost.js b/lost.js index 6c9b28c3..988e8544 100644 --- a/lost.js +++ b/lost.js @@ -26,7 +26,7 @@ var defaultSettings = { }; module.exports = postcss.plugin('lost', function lost(settings) { - settings = assign(defaultSettings, settings || {}); + settings = assign({}, defaultSettings, settings || {}); return function (css) { libs.forEach(function(lib) { diff --git a/test/lost-global-settings.js b/test/lost-global-settings.js new file mode 100644 index 00000000..858e2a47 --- /dev/null +++ b/test/lost-global-settings.js @@ -0,0 +1,26 @@ +'use strict'; + +var check = require('./check'); + +describe('lost-global-settings', function() { + it('resets global settings between builds', function() { + check( + '@lost clearing left; \n' + + 'a { lost-column: 1/3; }', + 'a { width: calc(99.9% * 1/3 - (30px - 30px * 1/3)); }\n' + + 'a:nth-child(1n) { float: left; margin-right: 30px; clear: none; }\n' + + 'a:last-child { margin-right: 0; }\n' + + 'a:nth-child(3n) { margin-right: 0; float: right; }\n' + + 'a:nth-child(3n + 1) { clear: left; }' + ); + + check( + 'a { lost-column: 1/3; }', + 'a { width: calc(99.9% * 1/3 - (30px - 30px * 1/3)); }\n' + + 'a:nth-child(1n) { float: left; margin-right: 30px; clear: none; }\n' + + 'a:last-child { margin-right: 0; }\n' + + 'a:nth-child(3n) { margin-right: 0; float: right; }\n' + + 'a:nth-child(3n + 1) { clear: both; }' + ); + }); +}); From c72917ba0396eece2202aeb8efc74643c7404899 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Tue, 5 Jul 2016 21:44:28 -0700 Subject: [PATCH 38/39] Removes tests/hacks not needed since #312 After #312, these "resets" are no longer necessary. --- test/lost-column.js | 8 -------- test/lost-waffle.js | 7 ------- 2 files changed, 15 deletions(-) diff --git a/test/lost-column.js b/test/lost-column.js index af7ed4fe..4747caf3 100644 --- a/test/lost-column.js +++ b/test/lost-column.js @@ -70,14 +70,6 @@ describe('lost-column', function() { ); }); - - it('reverts global back to default', function() { - check( - '@lost clearing both', - '' - ); - }); - it('provides none rule', function() { check( 'a { lost-column: none; }', diff --git a/test/lost-waffle.js b/test/lost-waffle.js index ab10a6e4..e057cb11 100644 --- a/test/lost-waffle.js +++ b/test/lost-waffle.js @@ -60,13 +60,6 @@ describe('lost-waffle', function() { ); }); - it('reverts global back to default', function() { - check( - '@lost clearing both', - '' - ); - }); - it('supports flexbox', function() { check( 'a { lost-waffle: 2/5 3 0 flex; }', From 795734c022b29074ec53d7d613c6a496f13106a5 Mon Sep 17 00:00:00 2001 From: Peter Ramsing Date: Tue, 5 Jul 2016 21:56:37 -0700 Subject: [PATCH 39/39] Bumps version for release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b95ec584..064e82dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lost", - "version": "7.0.1", + "version": "7.0.2", "description": "PostCSS fractional grid system built with calc() by the guy who built Jeet. Supports masonry, vertical, and waffle grids.", "main": "lost.js", "repository": {