peterramsing/lost

When using lost-move, have it retain the gutter if specified by a previous lost-column

sidonaldson opened this issue ยท 12 comments

Hi Cory, I think I've found a little bug with the lost-move where it seems to default to the global gutter value.
In the test case I have two columns (1/3 and 2/3) and I want to swap their positions and without any gutter.

div1{
  lost-column: 2/3 0 0 no-flex;
  lost-move: 1/3;
}
div2{
  lost-column: 1/3 0 0 no-flex;
  lost-move: -2/3;
}

The problem is that lost-move ignores the gutter override and you still get a gap and the offsets are out.
I can get around it by setting @lost gutter 0; but that's not ideal.

Demo: http://codepen.io/sidonaldson/pen/rxVvpm/

What do you think?

Looking at line 30 of the lib/lost-move.js file (lost-move.js), it looks like it it pulls the gutter from the default settings, not the previous lost-column: declaration.

That's not really an answer, I suppose.

Maybe the gutter could be passed on to lost-move if set by lost-column...

We can probably do something where we look through that current block of definitions for lost-column and detect if it has a gutter set, then set it for the lost-move declaration.

Thanks for pointing this out.

@sidonaldson Here's a codepen with this "fixed". http://codepen.io/peterramsing/pen/dGNXmK

You can specify the gutter within the lost-move rule. (see the codepen)
You can also use lost-move-gutter: 0;.

I'm working on getting the lost-move to read the gutter from the lost-column rule right now, though. Sorry for the delay on this. When I took over this repo I really wanted to get a handle on everything needed before diving into the code. This is slated to be done by next week, though. It's in the 6.6.4 milestone.

@corysimmons Was there any reason that lost-move.js doesn't use "newBlock()"?

Closing to migrate discussion to the PR #219

@corysimmons I think I answered my own question about new-block.js.

๐Ÿ‘ tbh, I'm not sure. I might have just overlooked it. If it works with newBlock, newBlock should probably be added so the property is uniform with the rest of them.

I'm noticing a few things that are inconsistent, but not breaking. Any refactor will have to wait. I'd love to get some of these bugs/issues deployed before doing any refactor work. Maybe when I have another long weekend I'll spend sometime doing that and maybe getting some linting in place.

Sounds good. ๐Ÿ‘

With the work that I did with the $lost-gutter variable I think this should be pretty simple now (or at least more simple?). As I'm getting close to finishing all the needs for version 8 early I'm adding this to the version 8 milestone for the December release.

Closing for #350