Commit 0b9369a3 authored by Fred Chasen's avatar Fred Chasen
Browse files

Merge branch 'inherit_wrapper_height' into 'main'

Fix #162: Inherit wrapper height from page area

Closes #162

See merge request !166
parents 8d64971a b58bf6db
Pipeline #32436 canceled with stage
......@@ -4,5 +4,4 @@ dist
lib
__diff_output__
specs/**/*.pdf
issues
.vscode
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<title>
Wapper Height
</title>
<script src="../../../dist/paged.polyfill.js"></script>
<style>
/* interface */
@media screen {
body {
background: whitesmoke;
}
.pagedjs_page {
background: white;
margin-bottom: 10px;
box-shadow: 0 0 0 1px rgba(0, 0,0,0.2);
}
.pagedjs_pages {
width: calc(var(--pagedjs-width) * 2);
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
margin: 0 auto;
}
}
</style>
<style>
#cover {
display: flex;
flex-direction: column;
justify-content: center;
height: 100%;
break-after: page;
align-items: flex-end;
background-color: green;
}
</style>
</head>
<body>
<div id="cover" class="title-page">
<h1>Title</h1>
</div>
<div id="content" class="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>This is a preamble.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_section">Section</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This is a paragraph.</p>
</div>
</div>
</div>
</div>
</body>
</html>
const TIMEOUT = 10000;
describe("wrapper-height", () => {
let page;
beforeAll(async () => {
page = await loadPage("issues/wrapper-height/wrapper-height.html");
return page.rendered;
}, TIMEOUT);
afterAll(async () => {
if (!DEBUG) {
await page.close();
}
});
it("should render 2 pages", async () => {
let pages = await page.$$eval(".pagedjs_page", (r) => {
return r.length;
});
expect(pages).toEqual(2);
});
if (!DEBUG) {
it("should create a pdf", async () => {
let pdf = await page.pdf(PDF_SETTINGS);
expect(pdf).toMatchPDFSnapshot(1);
});
}
}
);
......@@ -385,6 +385,10 @@ export default `
column-fill: auto;
}
.pagedjs_pagebox > .pagedjs_area > .pagedjs_page_content > div {
height: inherit;
}
.pagedjs_pagebox > .pagedjs_area > .pagedjs_footnote_area {
position: relative;
overflow: hidden;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment