css - Nesting and looping with less incremental -
i not sure how implement in less, not sure start.
the purpose increment padding variable(15px in example) depth (increment variable). possible in less?
ul { li{ padding-left: 30px; } ul { li{ padding-left: 45px; } ul { li{ padding-left: 60px; } ul { li{ padding-left: 75px; } ul { li{ padding-left: 90px; } } } } } }
see loops, e.g.:
.make-nested-lists(5); .make-nested-lists(@n, @i: 0) when (@i < @n) { ul li { padding-left: (30px + 15 * @i); .make-nested-lists(@n, (@i + 1)); } }
Comments
Post a Comment