fixing page breaks in the print hTML

This commit is contained in:
Amruth Pillai
2020-03-27 20:36:16 +05:30
parent 866e4ae6d7
commit 6eccbd5373
3 changed files with 11 additions and 5 deletions

View File

@ -40,7 +40,7 @@ const App = () => {
<div className="z-0 h-screen col-span-3 flex justify-center items-center overflow-scroll"> <div className="z-0 h-screen col-span-3 flex justify-center items-center overflow-scroll">
<div <div
id="page" id="page"
className="animated fadeIn p-10 my-auto shadow-2xl" className="animated fadeIn my-auto shadow-2xl"
style={{ animationDelay: '500ms' }} style={{ animationDelay: '500ms' }}
> >
{renderTemplate()} {renderTemplate()}

View File

@ -67,6 +67,7 @@ li {
width: 21cm; width: 21cm;
height: 29.7cm; height: 29.7cm;
zoom: 0.8; zoom: 0.8;
padding: 2.5em;
overflow: scroll; overflow: scroll;
background-color: white; background-color: white;
} }
@ -74,7 +75,7 @@ li {
@page { @page {
size: A4; size: A4;
margin: 0; margin: 2.5em;
} }
@media print { @media print {
@ -82,19 +83,20 @@ li {
body, body,
body * { body * {
-webkit-print-color-adjust: exact; -webkit-print-color-adjust: exact;
color-adjust: exact;
visibility: hidden; visibility: hidden;
} }
#page, #page,
#page * { #page * {
page-break-inside: avoid;
visibility: visible; visibility: visible;
} }
#page { #page {
background-color: white; background-color: white;
width: 21cm;
height: 29.7cm;
margin: 0; margin: 0;
padding: 0;
box-shadow: none; box-shadow: none;
position: absolute; position: absolute;
left: 0; left: 0;

View File

@ -11,7 +11,11 @@ const Pikachu = () => {
const Photo = () => const Photo = () =>
data.profile.photo !== '' && ( data.profile.photo !== '' && (
<div className="self-center col-span-4"> <div className="self-center col-span-4">
<img className="h-48 rounded-full mx-auto object-cover" src={data.profile.photo} alt="" /> <img
className="w-48 h-48 rounded-full mx-auto object-cover"
src={data.profile.photo}
alt=""
/>
</div> </div>
); );