Answer the question
In order to leave comments, you need to log in
How to add a class to only the first tag in a jade-generated list?
Good afternoon!
There is a jade code:
nav.main-nav
each val in ["Journal", "About", "Work", "Contact"]
a(href="/").main-nav__item= val
Answer the question
In order to leave comments, you need to log in
each val, index in ["Journal", "About", "Work", "Contact"]
- var class = 'main-nav__item';
- class += index === 0 ? ' special' : ''
a(href="/", class="#{class}")= val
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question