sigil88
5/3/2017 - 11:02 AM

stylus foreach loop example, headings etc

stylus foreach loop example, headings etc

// Loop through multiple heading tags with stylus without having to write each one out traditionally.

for $i in (1..6)
    h{$i}
        color #333


Or example from stackoverflow:

for $i in (1..6)
    h{$i}
        &:before
            content "h" + $i

// http://stackoverflow.com/questions/43259539/not-working-stylus-heading-loop-before-content