lost icon indicating copy to clipboard operation
lost copied to clipboard

nth-of-type support

Open zgreen opened this issue 10 years ago • 16 comments

It would be great if Lost supported nth-of-type() grid spans in addition to the current nth-child() implementation.

Use case

article {
  lost-column: 1/3;
}
<section>
  <h2>Section heading</h2>
  <article></article>
  <article></article> <!-- This article gets no gutter, but should have one. -->
  <article></article> <!-- This article gets cleared, but should instead be the last in the row. -->
  <!-- etc. -->
</section>

Obviously, one can work around this by simply adding a wrapping element, but that solution may neither be semantic nor desired.

I'm happy to submit a PR, if you're interested. Thanks for all your work—this project is terrific.

zgreen avatar Nov 29 '15 17:11 zgreen

👍🏻

peterramsing avatar Nov 29 '15 19:11 peterramsing

Yeah I'd be interested in a PR for this. It'd need to be a global setting as well as on a per-element basis.

corysimmons avatar Nov 29 '15 20:11 corysimmons

Terrific, I'll put something together.

zgreen avatar Nov 29 '15 21:11 zgreen

+1 Just ran into this

Dylan-Chapman avatar Dec 04 '15 21:12 Dylan-Chapman

@zgreen Are you still up for working on a PR? (or maybe you already are) :smile: Any help would be epic!

peterramsing avatar Dec 29 '15 03:12 peterramsing

@zgreen I just noticed that you forked and had some work going already on this. Let me know if you need anything.

peterramsing avatar Dec 29 '15 07:12 peterramsing

Yeah, it's just about there—work got in the way. Got it working w/ lost-column, tests passing. I made some changes so that you can pass the parameters optionally/in any order—have a look when I submit the PR. I need to implement it for lost-row, add a few more tests, and then it should be good to go. Hopefully can finish this off today.

zgreen avatar Dec 29 '15 13:12 zgreen

Thanks! Don't worry about any sort of rush. Enjoy this last week before 2016.

peterramsing avatar Dec 29 '15 16:12 peterramsing

:+1:

zgreen avatar Dec 29 '15 22:12 zgreen

It'd be really cool if all Lost's rules could accept values in any order. :^\

corysimmons avatar Dec 30 '15 01:12 corysimmons

@corysimmons I'm looking into this, actually. I'm curious what it will take. Still really diving into the code right now to better understand it all as a whole. :smile:

peterramsing avatar Dec 30 '15 02:12 peterramsing

@corysimmons see #213 for follow up to your last comment.

peterramsing avatar Dec 30 '15 07:12 peterramsing

@peterramsing Feel free to ping me while you're diving into code for explanations about anything. Happy to help you wrap your head around my garbage code. :^)

corysimmons avatar Dec 31 '15 21:12 corysimmons

@corysimmons You bet! I plan to sift through all the code + tests (#208) tonight and though the weekend. I'll probably release a 6.6.3 release with the npm updates through the weekend and then pursue #195 to get another patch out before getting 6.7.x scoped and begin the roadmap to 7.0.0. I'll probably ping you throughout. :smile:

peterramsing avatar Dec 31 '15 21:12 peterramsing

Awesome, you're doing an amazing job! I'm so happy you took this project over.

corysimmons avatar Dec 31 '15 21:12 corysimmons

:+1:

peterramsing avatar Dec 31 '15 21:12 peterramsing