A named page cannot be the first page
If the first page in the document is a named page (e.g. @page documentCoverPage
with page: documentCoverPage
on the appropriate CSS class), a blank page will be inserted before it.
I if use @page :first
instead, no blank page is inserted.
It appears just inserting page: documentCoverPage
into the relevant CSS class ensures a blank page will inserted at the start of the document.
Examples (these work best in Chrome):
- This uses
@page :first
. My cover page is the first page, as expected: https://codesandbox.io/s/vigorous-worker-leh105 - This uses
@page documentCoverPage
. My cover page now becomes the second page. https://codesandbox.io/s/restless-worker-0by3yp - In this example, I use
@page :first
but on line 131 I havepage: documentCoverPage;
. I get a blank page at the start of the document. https://codesandbox.io/s/intelligent-bohr-1qv33w?file=/index.html:2878-2944
This happens in 0.3.5 and 0.4.0beta3.