0

Say you have the zen snippet:

div#container>(div.panel>h2{this is the header inside panel $})*3

it will evaluate to:

<div id="container">
    <div class="panel">
        <h2>this is the header inside panel 1</h2>
    </div>
    <div class="panel">
        <h2>this is the header inside panel 1</h2>
    </div>
    <div class="panel">
        <h2>this is the header inside panel 1</h2>
    </div>
</div>

Is there a way to make it evaluate passing the index of the multiplied element though to its children?

Thanks.

1 Answer 1

0

It’s a bug of current version of Zen Coding core: it’s incorrectly set-up counter value when group is repeated. But in this particular case you can get desired result with this abbreviation:

div#container>div.panel*3>h2{this is the header inside panel $}

In the upcoming v0.8 release this bug was fixed, you can test it out here: http://media.chikuyonok.ru/codemirror2/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.