1

I am using jade instead of HTML and jinja template. I need to add a particular class after checking some variables value.

section.all-articles.large-7.columns

Here in the above line of code I need to add another class .mid

{% if articles|length < 10 %}
//add a class .mid
{% endif %}

And I want my resultant as

section.all-articles.large-7.columns.mid when its converted to html.

Rahul Shrivastava
  • 1,391
  • 3
  • 14
  • 38
  • Check out these posts.. http://stackoverflow.com/questions/14144274/jade-conditional-if-else-to-add-class-to-div-inline http://stackoverflow.com/questions/13668881/variable-in-class-name-jade – Rastalamm Mar 29 '16 at 14:22

1 Answers1

0
section.all-articles.large-7.columns#ko-container(class!="{% if articles|length < 10 %}mid{% endif %}")
Rahul Shrivastava
  • 1,391
  • 3
  • 14
  • 38