Answer the question
In order to leave comments, you need to log in
How to write a mixin in LESS?
How to write .icon-before() with less to:
.icon-before("post", "file", "book", "check", "image", "globe", /* ... */ "data" );
.icon-post:before { content: '\e800'; }
.icon-file:before { content: '\e801'; }
.icon-book:before { content: '\e802'; }
.icon-check:before { content: '\e803'; }
.icon-image:before { content: '\e804'; }
.icon-globe:before { content: '\e805'; }
// ...
.icon-data:before { content: '\e80f'; }
Answer the question
In order to leave comments, you need to log in
.icon-before(@list...) {
.do(@index, @list) when (@index <= length(@list)) {
@name: extract(@list, @index);
[email protected]{name}:before {
content: replace(%("\%a", rgb(0, 232, @index)), "#00", '')
}
.do(@index + 1, @list);
}
.do(1, @list);
}
.icon-before(post, file, book, check, image, globe, data, a1, a2, a3, a4);
As far as I know, there are no cycles in loess, they are in sass.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question