import print.css

This commit is contained in:
Reorx 2023-02-06 00:16:31 +08:00
parent fd3f92e6b3
commit aa2ac69904
5 changed files with 41 additions and 62 deletions

View File

@ -2,44 +2,6 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
/* Page setup works for all the themes */
@page {
/* A4 */
/* size: 210mm 297mm; */
size: A4;
margin: 10mm; /* approximately 0.4in */
}
html {
margin: 0;
padding: 0;
}
body {
margin: 0;
page-break-inside: auto;
print-color-adjust: exact;
-webkit-print-color-adjust: exact;
/* simulate print page size */
padding: 10mm;
width: calc(210mm - 20mm);
border: 1px solid #ccc;
border-left: 0;
}
@media print {
/* remove simulate print page size, let @page decide the size and margin */
body {
padding: 0;
border: 0;
}
}
.page-unit {
page-break-inside: avoid;
page-break-after: auto;
}
</style>
<title>CV</title>
</head>
<body>

View File

@ -1,3 +1,5 @@
import '../print.css';
import {
getCVData,
getCVSavedTime,

View File

@ -2,29 +2,6 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/* Page setup works for all the themes */
@page {
size: 210cm 297cm; /* A4 */
}
body {
padding: 0;
margin: 10mm;
/* margin subtracted */
width: 190cm;
height: 277cm;
page-break-inside: auto;
print-color-adjust: exact;
}
.page-unit {
page-break-inside: avoid;
page-break-after: auto;
}
</style>
<title>CV</title>
</head>
<body>

View File

@ -1,4 +1,6 @@
import * as exampleData from '../data/rxresume-converted.json';
import './print.css';
import * as exampleData from '../data/rxresume-mengxiao.converted.json';
import { applyThemeTo } from './themer';
const elCV = document.querySelector('.cv-container')

36
src/print.css Normal file
View File

@ -0,0 +1,36 @@
/* Page setup works for all themes */
@page {
/* A4 */
/* size: 210mm 297mm; */
size: A4;
margin: 10mm; /* approximately 0.4in */
}
html {
margin: 0;
padding: 0;
}
body {
margin: 0;
page-break-inside: auto;
print-color-adjust: exact;
-webkit-print-color-adjust: exact;
/* simulate print page size */
padding: 10mm;
width: calc(210mm - 20mm);
border: 1px solid #ccc;
border-left: 0;
}
@media print {
/* remove simulate print page size, let @page decide the size and margin */
body {
padding: 0;
border: 0;
}
}
.page-unit {
page-break-inside: avoid;
page-break-after: auto;
}