Open mrchristian opened 3 years ago
If we want the page counter starting with 0 for the very first page (front cover), we can reset the page counter in the stylesheet as follows:
@page :first {
counter-reset: page -1;
}
and when we support @page :nth(1)
(see https://github.com/vivliostyle/vivliostyle.js/issues/667#issuecomment-738020563), the page counter can be reset at any document in a publication.
Now, Vivliostyle.js v2.5.0 supports the :nth()
page selector.
See #700 feat(core): Support the :nth() page selector
- In multi-document publications, the
:nth(1)
matches the first page of each document, but the:first
matches only the first page of the first document. (see: https://github.com/vivliostyle/vivliostyle.js/issues/667#issuecomment-738020563 )
You can use @page :nth(1) { counter-reset: page; }
to reset the page counter at each or a specific document in a web book.
Test sample:
All formats need page one to be set as the title page. This is an issue where a front cover is included.