fix: force text-slate to black in PDF export for better contrast

This commit is contained in:
2026-06-23 12:42:51 +00:00
parent b0837ca893
commit c04dcc0200
2 changed files with 26 additions and 1 deletions
+7 -1
View File
@@ -19,8 +19,12 @@ export const exportAsPdf = async (elementId: string, fileName: string, action: '
const isDark = document.documentElement.classList.contains('dark');
if (isDark) {
document.documentElement.classList.remove('dark');
await new Promise(resolve => setTimeout(resolve, 100)); // Allow CSS to recompute
}
// Add pdf-export class to force high contrast text
container.classList.add('pdf-export');
await new Promise(resolve => setTimeout(resolve, 100)); // Allow CSS to recompute
const pdf = new jsPDF({
orientation: 'portrait',
@@ -50,6 +54,8 @@ export const exportAsPdf = async (elementId: string, fileName: string, action: '
pdf.addImage(imgData, 'JPEG', 0, 0, pdfWidth, pdfHeight);
}
container.classList.remove('pdf-export');
if (isDark) {
document.documentElement.classList.add('dark');
}