-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Creating list output in less #2699
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
Comments
Not without custom functions. I baked a map/reduce based on detached rulesets and calling them from custom plugin functions myself some time ago, but it's pretty involved. Iirc there was somethin regarding building support for list comprehension and/or an (inverse) spread operator into Less some time ago. If that follows through, it will become substantially more easy. |
Yes, though the trick is that first of all he does not need to create such list at all for his use-case. And secondary even if he would, just plain concatenation will also work just fine (even if resulting list would not be a plain list). (I just did not have time to answer the SO question since currently I'm away from my normal Less environment). |
Looping is already possible, all you are missing is list concatenation and concatenation will be possible after next release due to #1857
|
Yup. That's the (inverse) spread operator I was referring to before. |
I answered http://stackoverflow.com/questions/32665124 (as well as commented on the original OP's use-case at http://stackoverflow.com/questions/32658697, thus yet again stressing it's an "XY Problem" and the OP does not need anything like above at all), so I suppose now it's safe to close this (as an offtopic-here "How-To" question). |
Closing as not an issue. |
I am trying to create a list which is calculated from another list. For example, if I have a list like 1,2,3,4... then the output has to be 10,20,30,40... Is there any other way to create a list from another in less? Please refer the below codes.
The above implementation similar I expect like below.
and the output is #fff, #aaa, #ccc.
The text was updated successfully, but these errors were encountered: