-
-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple grid layout #239
Comments
There's no Lost property for that yet. We could probably make one with some nth-child hackery. Like In the meantime, if you only need 3 elements in there, you can do this: http://codepen.io/corysimmons/pen/MKvNBY?editors=110 Here's what the CSS would look like if We should probably implement this even if it makes Lost a bit more complex. It adds a solution to an question and I'm not aware of any other grid that attempts to solve this problem. The code would need to work for any property |
^ I may have gone a bit crazy with the labels. :X |
@corysimmons I think you might be looking for the *edit: now that I'm thinking about it, all those labels are accurate and |
So after playing with your example, I can see that by tweaking Now, let's say I do
but I have no control over the b parameter in the I think that if |
@Adrianca That's the general concept but the nth-child selector is confusing in practice. Which makes more sense at first glance? .full {
display: block;
}
.half {
lost-column: 1/2;
lost-nth-child: 2n + 1;
} or .full {
display: block;
}
.half {
lost-column: 1/2;
lost-cycle-after: 1;
} That said, |
So the way Im thinking about it, is that Moreover, like you said yourself a This is some feedback that I'm offering from a user's point of view, but it might just be a matter of taste though. |
The difficulty regarding implementation would be parsing the value expressions, but it shouldn't be too much of a big deal with some regex magic ;) |
Okay, so forget I like this idea. We'd need to wrap the shorthand Catching that arg and using regex is what I was thinking and I can see how to implement it already, but I'm 99% sure this won't support all possible nth-child patterns out of the box... It kind of seems like we'd have to rewrite how browsers implement the nth-child selector with JS and regex. :\ |
And what about people who want to use lost-column: 1/2;
lost-nth-of-type: 2n + 1; lost-column: 1/2 (2n + 1) type; ? If we're going to do something like this, I reeeeally think we should reconsider even offering shorthand as it's not explicit at all. |
I can't remember why I added in I feel like there was a legit reason for it though... I just can't remember. Too bad I don't write good commit messages. :^( Update: I remember why I added it. I wanted rows to clear each other in this weird/rare situation http://codepen.io/corysimmons/pen/zrEojp?editors=110 I think we should drop This would be super exciting and make |
Yeah I originally meant to include the expression inside the shorthand
So I agree with you that maybe dropping the shorthand would be ideal, in favor of more advanced properties that allow for more customization. More explicit, more readable, and more powerful. 👍 |
Sorry to be so out of the loop on this. Got sick and am just cracking the laptop today. This conversation is awesome, though. @corysimmons Already said it, but to second the motion that there are other @Adrianca You made a great point about there being super users and users that want something that just works out of the box. I think that these properties should be broken out of the shorthand. I'm an advocate for more verbose code (within reason) that self-documents. Especially these days with auto-complete. |
@peterramsing agreed! |
Another needed feature/enhancement for sure. |
@peterramsing Just wanted to confirm that it wasn't implemented yet. |
@Adrianca Code machine. I really need to get some more roadmap/7.0.0 definition done soon! |
@Adrianca That being said–I want to make sure that we don't bite off more than we can chew with 7.0.0. I think that the more features the merrier, but do you have any gut feelings that this should wait till later? Maybe we do make 7.0.0 a huge release with all these features. |
@peterramsing It's done now. I added it to PR 241. |
@corysimmons @peterramsing Wondering how I can achieve the following layout using lost:
I have some markup that sets the container element, and
1
haslost-column: 1
, and each of2
,3
,4
and5
havelost-column: 1/2
but they show up on top of each other because of themargin-right
. Is there any property that I can use to tell lost that I want nomargin-right
after3
and5
, so that they show up on the same row?Thanks!
The text was updated successfully, but these errors were encountered: