less / less.js

Less. The dynamic stylesheet language.
http://lesscss.org
Apache License 2.0
17.02k stars 3.41k forks source link

index function for value list #2078

Open kaptinlin opened 10 years ago

kaptinlin commented 10 years ago

http://www.smashingmagazine.com/2014/06/12/sassy-z-index-management-for-complex-layouts/

any plan this function support?

seven-phases-max commented 10 years ago

There was not enough demand before I guess (so those who are interested just write their mixins for this case (e.g. me)). That's pretty trivial thing to add and the only suggestion is to use index-of name instead (just index is too "fundamental" name and we never know what kind of stuff we'll need it for eventually).

thecreation commented 10 years ago

Good thought. I like index-of.

gu-stav commented 9 years ago

Giving my +1 to that issue. I think it's fine to only have index(), since SASS has it aswell.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Hellowor1d commented 5 years ago

This is really a good feature for z-index management ~ Giving my +1 to the issue 👍

matthew-dean commented 5 years ago

Just to be clear, this is just a function that increments each time that it's called?

This feels like such a niche function that this is more appropriate as a @plugin.

seven-phases-max commented 5 years ago

@matthew-dean

Just to be clear, this is just a function that increments each time that it's called?

No, it's about a function returning the index of the specified value in a list. E.g. basically like Array.indexOf.of JS.