A
A
Adex2017-08-09 19:53:50
Pug
Adex, 2017-08-09 19:53:50

Pug how to set default class before specifying others in attributes?

The question arose, how to set the class name for li so that it changes for nested li? Now the class is set for nested lis, but if I write a class separately, then as a result, li gets two classes. And is it possible somehow by analogy to make different classes for the main ul and nested ones?

mixin list(data)
  ul
    each item in data.items
      li(class!=attributes.class)= item.title
        if item.sublevel
          +list(item)(class="into-nav-menu_item")

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Adexs, 2017-08-09
@Adex

Used for this purpose the code of the form
but the compiler swears at the number of attributes of the tag.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question