family.scss icon indicating copy to clipboard operation
family.scss copied to clipboard

Every N after X

Open lachieh opened this issue 9 years ago • 6 comments

This possibly relates to issue #37, but it may also want to be a separate function. It'd be great to have a function to select every Nth item after the Xth child.

For example:

li {
    @include n-after(3,6)
    ....
}

would return

li:nth-child(3n+9) {
  ....
}

Note that it's +9, instead of +6 because +6 would highlight every 3rd including the 6th, instead of starting after. I've used this before for targeting the second row and on.

In addition, n-before in the same format would also be helpful, utilizing :nth-last-child instead of nth-child

lachieh avatar Jun 06 '16 19:06 lachieh

Hi! Sorry for the late response!

Yeah, the idea of #37 ( and #61 ) is exactly the following :

... select every Nth item after the Xth child.

Thank you for your in depth explanations, and your participation. I don't really have time this week to take care of all the requests and issues fixing, but I'll definitely make a huge improvement for the next release, adding those new mixins ( which should be the v1.1.0 if everything goes as expected )

LukyVj avatar Jun 09 '16 08:06 LukyVj

On it :)

LukyVj avatar Oct 26 '16 10:10 LukyVj

Hey @LukyVj @jolidog, would you mind giving this a final push? :)

mzdr avatar Jun 17 '18 21:06 mzdr

Hello @mzdr Yeah actually this totally got lost in my todo and as you may realize, I totally forgot about this.

I'm currently drowning into work, so if one of you feels like making a PR for it, I would gladly approve and merge it :)

LukyVj avatar Jun 18 '18 09:06 LukyVj

Hey @LukyVj,

it’s all cool. I was hoping that @jolidog may finalize his PR #78? I think there is just a couple of conflicts left, as you wrote, which need to be solved.

mzdr avatar Jun 18 '18 10:06 mzdr

I've just made another PR as #92. This is an extension of #78 but the only thing I added is the merge conflict.

lachieh avatar Jun 18 '18 13:06 lachieh