Implement A4 page simulation with exact dimensions

- Update main.css with A4 dimensions (210mm × 297mm)
- Add CSS variables for consistent sizing
- Implement page-break-inside: avoid for sections
- Optimize font sizes for A4 layout
- Update print.css for perfect PDF export
- Responsive: switches to 100% width on mobile
This commit is contained in:
juanatsap
2025-10-27 22:39:29 +00:00
parent cd5d5cff02
commit 4ec966591d
2 changed files with 241 additions and 297 deletions
+102 -187
View File
@@ -1,17 +1,15 @@
/* Print Styles - Optimized for PDF Export */
/* Print Styles - A4 Optimized */
@media print {
/* Reset for print */
* {
-webkit-print-color-adjust: exact !important;
print-color-adjust: exact !important;
color-adjust: exact !important;
}
/* Page setup */
@page {
size: A4;
margin: 1.5cm;
margin: 0;
}
body {
@@ -27,256 +25,173 @@
display: none !important;
}
/* CV Container adjustments */
/* CV Container - full page */
.cv-container {
width: 100%;
max-width: 100%;
margin: 0;
padding: 0;
gap: 0;
}
.cv-paper {
width: 210mm;
min-height: 297mm;
background: white;
padding: 20mm;
box-shadow: none;
border-radius: 0;
padding: 0;
min-height: auto;
margin: 0;
page-break-after: auto;
}
/* Typography */
body {
font-size: 10pt;
line-height: 1.4;
/* Force page breaks where needed */
.page-break {
page-break-after: always;
}
.cv-name {
font-size: 24pt;
page-break-after: avoid;
}
.cv-title {
font-size: 14pt;
page-break-after: avoid;
}
.section-title {
font-size: 14pt;
page-break-after: avoid;
margin-top: 1.5em;
}
/* Prevent page breaks */
.cv-header,
.avoid-break,
.cv-section,
.experience-item,
.project-item,
.education-item,
.award-item {
.project-item {
page-break-inside: avoid;
}
/* Links */
a {
color: #2563eb;
text-decoration: none;
}
a[href]:after {
content: none; /* Don't print URLs */
}
/* Compact spacing for print */
/* Header */
.cv-header {
margin-bottom: 1em;
padding-bottom: 0.5em;
page-break-after: avoid;
margin-bottom: 15mm;
}
.cv-section {
margin-bottom: 1.5em;
.cv-name {
font-size: 20pt;
}
.experience-item,
.project-item {
margin-bottom: 1em;
padding-bottom: 0.75em;
.cv-title {
font-size: 12pt;
}
/* Contact info - make it more compact */
.cv-contact {
grid-template-columns: repeat(2, 1fr);
gap: 0.3em;
.cv-photo {
width: 80px;
height: 80px;
border-width: 2px;
}
/* Sections */
.section-title {
font-size: 12pt;
margin-top: 10mm;
page-break-after: avoid;
}
.summary-text {
font-size: 9pt;
line-height: 1.5;
}
/* Experience */
.experience-item {
margin-bottom: 8mm;
padding-bottom: 8mm;
}
.position {
font-size: 10pt;
}
.company {
font-size: 9pt;
}
/* AI Section - maintain visibility in print */
.ai-section {
background: #f0f9ff !important;
border-left: 3px solid #2563eb !important;
padding: 1em !important;
margin: 1em 0 !important;
.experience-period {
font-size: 8pt;
}
.ai-skill-category {
background: white !important;
padding: 0.75em !important;
margin-bottom: 0.5em;
box-shadow: none;
border: 1px solid #e5e5e5;
.short-desc,
.responsibilities li {
font-size: 9pt;
line-height: 1.4;
}
.ai-achievements {
background: white !important;
padding: 0.75em !important;
border: 1px solid #e5e5e5;
.technologies {
font-size: 8pt;
}
/* Skills grid - more compact */
.skills-grid {
grid-template-columns: repeat(2, 1fr);
gap: 0.75em;
.company-logo {
width: 25px;
height: 25px;
}
.skill-category {
background: #f9fafb !important;
padding: 0.75em !important;
/* Education, Skills, etc */
.degree,
.skill-title,
.project-name {
font-size: 9.5pt;
}
/* Certifications grid */
.certifications-grid {
grid-template-columns: repeat(2, 1fr);
gap: 0.5em;
.institution,
.skill-list,
.project-description {
font-size: 8.5pt;
}
.certification-item {
background: #f9fafb !important;
padding: 0.75em !important;
/* Certifications & Awards */
.cert-item,
.award-item {
font-size: 8.5pt;
margin-bottom: 2mm;
}
/* Languages */
.languages-grid {
.languages-list {
grid-template-columns: repeat(3, 1fr);
gap: 0.5em;
}
.language-item {
background: #f9fafb !important;
padding: 0.75em !important;
font-size: 8.5pt;
}
/* Badges and tags */
.proficiency-badge,
.highlight-badge,
.soft-skill-tag {
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
/* Contact info */
.cv-contact {
font-size: 8.5pt;
grid-template-columns: repeat(2, 1fr);
gap: 2mm;
}
.proficiency-badge {
background: #2563eb !important;
color: white !important;
}
.highlight-badge {
background: #fef3c7 !important;
color: #92400e !important;
}
.soft-skill-tag {
background: #e0e7ff !important;
color: #3730a3 !important;
/* Links - print URLs */
a {
color: #0066cc;
text-decoration: none;
}
/* Ensure borders print */
.cv-header {
border-bottom: 2px solid #2563eb !important;
border-bottom: 1.5pt solid #2d2d2d !important;
}
.section-title {
border-bottom: 1px solid #e5e5e5 !important;
border-bottom: 0.5pt solid #dddddd !important;
}
.experience-item,
.project-item,
.award-item {
border-bottom: 1px solid #e5e5e5 !important;
.experience-item {
border-bottom: 0.5pt solid #dddddd !important;
}
/* Reduce list spacing */
.responsibilities,
.ai-skill-list,
.achievement-list,
.skill-items,
.project-highlights {
margin: 0.5em 0;
.experience-item:last-child {
border-bottom: none !important;
}
.responsibilities li,
.ai-skill-list li,
.achievement-list li,
.skill-items li,
.project-highlights li {
margin-bottom: 0.25em;
/* Print both short and long version content */
.cv-short .long-only,
.cv-long .long-only {
display: block !important;
}
/* Font size adjustments for print */
.summary-text {
font-size: 9.5pt;
line-height: 1.5;
.cv-short .short-desc {
display: none !important;
}
.position {
font-size: 11pt;
}
.company,
.institution {
font-size: 9.5pt;
}
.responsibilities,
.project-description {
font-size: 9pt;
}
.technologies {
font-size: 8.5pt;
}
/* Optimize spacing */
.ai-description {
margin-bottom: 0.75em;
}
.experience-header,
.project-header,
.education-header {
margin-bottom: 0.5em;
}
/* Ensure stars print correctly */
.proficiency-stars {
color: #fbbf24 !important;
}
/* Compact soft skills */
.soft-skills-list {
gap: 0.25em;
}
.soft-skill-tag {
padding: 0.25em 0.5em;
font-size: 8pt;
}
}
/* Print button functionality */
@media screen {
.print-only {
display: none;
}
}
@media print {
.print-only {
display: block;
/* Always print full CV in long mode */
.cv-long .short-desc {
display: none !important;
}
}