feat(resume): enhance spacing, styling, and add markdown text parsing

- Update section spacing from mb-8 to mb-12 for improved visual hierarchy
- Refine heading padding and margins for consistent section styling
- Adjust work experience highlights spacing and add leading-relaxed for readability
- Implement markdown bold text parsing in job highlights using new composable
- Add color-coded icons in resume header (red for location, green for phone, amber for email, blue for website)
- Reorganize contact information into two lines for better layout organization
- Standardize icon sizing with explicit w-4 h-4 dimensions across header
- Create useMarkdownText composable for markdown formatting utilities
- Update resume data and PDF export endpoint to support enhanced styling
- Improve print styling consistency across all resume components
This commit is contained in:
mahdiarghyani
2025-12-06 14:04:45 +03:30
parent 73afa9f5a6
commit 12c8847447
9 changed files with 130 additions and 51 deletions
+51 -4
View File
@@ -51,12 +51,20 @@ export default defineEventHandler(async (event) => {
throw new Error(`Failed to load: ${response?.status()}`)
}
// Inject critical CSS fixes
// Wait for Vue hydration and v-html rendering to complete
await page.waitForSelector('strong', { timeout: 5000 }).catch(() => {
console.log('[PDF API] No strong tags found, continuing anyway')
})
// Additional wait to ensure all dynamic content is rendered
await new Promise(resolve => setTimeout(resolve, 1000))
// Inject critical CSS fixes for PDF generation - optimized for exactly 2 pages
await page.addStyleTag({
content: `
@page {
size: A4;
margin: 1.2cm;
margin: 1cm;
}
* {
@@ -65,6 +73,8 @@ export default defineEventHandler(async (event) => {
hyphens: none !important;
-webkit-hyphens: none !important;
-ms-hyphens: none !important;
print-color-adjust: exact !important;
-webkit-print-color-adjust: exact !important;
}
html, body {
@@ -90,18 +100,55 @@ export default defineEventHandler(async (event) => {
}
.resume-content {
padding: 0 !important;
padding: 1rem !important;
}
/* Balanced spacing for sections - fits exactly 2 pages */
section {
margin-bottom: 1.5rem !important;
page-break-inside: auto !important;
break-inside: auto !important;
}
h2 {
section:last-child {
margin-bottom: 0 !important;
}
/* Section titles */
section h2 {
margin-bottom: 0.7rem !important;
padding-bottom: 0.3rem !important;
page-break-after: avoid !important;
break-after: avoid !important;
}
/* Work experience job blocks */
section > div {
margin-bottom: 1rem !important;
}
section > div:last-child {
margin-bottom: 0 !important;
}
/* Bullet lists */
ul {
margin-top: 0.5rem !important;
}
ul li {
margin-bottom: 0.25rem !important;
line-height: 1.45 !important;
}
strong {
font-weight: 700 !important;
}
/* Summary paragraph - more line height */
section > p {
line-height: 1.75 !important;
}
`,
})