问题
<ul>
<li></li>
<li></li>
<li></li>
...
<li></li>
</ul>
Is it possible to get the 'n' value o the last item of a dinamic list with Sass? Like counting the number of items within the 'ul' using the @each or @for statements ?
回答1:
No. Sass only compiles to CSS. It is never sent to the browser. It has no knowledge of the DOM.
来源:https://stackoverflow.com/questions/28129352/how-could-i-get-the-number-of-items-in-a-dynamic-list-with-sass