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.

dda
  • 6,030
  • 2
  • 25
  • 34
Jai
  • 2,096
  • 5
  • 25
  • 37

1 Answers1

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/

Sergey Chikuyonok
  • 2,626
  • 14
  • 13