V
V
Vitaliy Antal2020-03-24 23:29:21
HTML
Vitaliy Antal, 2020-03-24 23:29:21

Is it possible in Pug to substitute the parent selector?

In Sass it is possible to use the & character to denote a parent selector, is there a similar feature in Pug? for example

.my_class
    &_inner
        &_more

and to get the output:
<div class="my_class">
    <div class="my_class_inner">
        <div class="my_class_inner_more"></div>
    </div>
</div>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WapSter, 2020-03-24
@vantal

Yes, only under BEM for webpack there is a pug-bem-plain-loader loader, something similar was also for gulp. Syntax

.block._mod
   .__element._mod

S
starsun26, 2020-03-26
@ss26

https://github.com/kizu/bemto

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question