Forum Feature requests

"n" in @page:nth()

ThatRobHuman
I've run into a situation where I want to have several background images that repeatedly cycle (for example, with three images, the image on first spread, second image on second spread, third image on third spread, first image on the fourth spread, etc, etc).

Normally, I would achieve this by using @page:nth(3n + 1) and so on, but it would appear that prince doesn't support the "n" operator in @page:nth()

may I ask that y'all consider adding support for the "n" operator within @page:nth()

the full code for that example that I'd use would be, just for completion's sake.

        @page:nth(6n+1) { background: url("../assets/bg/1.svg"); }
        @page:nth(6n+2) { background: url("../assets/bg/1.svg"); }
        @page:nth(6n+3) { background: url("../assets/bg/2.svg"); }
        @page:nth(6n+4) { background: url("../assets/bg/2.svg"); }
        @page:nth(6n+5) { background: url("../assets/bg/3.svg"); }
        @page:nth(6n+6) { background: url("../assets/bg/3.svg"); }

        @page:right { background-position: center right; }
        @page:left { background-position: center left; }

Edited by ThatRobHuman

mikeday
We will take a look at this, in the meantime perhaps you could use a little JavaScript to generate @page:nth() lines from 1..100 say :D
ThatRobHuman
I getchu. That's basically what I've done as a work-around, but let's be real: it doesn't taste very good.

Loving the program, by the way - already making plans to divorce InDesign.
mikeday
Love to hear that! We will do our best to improve the taste :D