Improve CSS preprocessing

This commit is contained in:
Andrew Kingston 2025-04-01 20:19:11 +01:00
parent 51ba8510a8
commit 66bff41b31
No known key found for this signature in database
1 changed files with 6 additions and 11 deletions

View File

@ -46,10 +46,13 @@
} }
const preprocessCSS = () => { const preprocessCSS = () => {
const els = document.getElementsByClassName( const els = document.getElementsByClassName("grid-child")
"grid-child"
) as unknown as HTMLElement[]
for (let el of els) { for (let el of els) {
if (!(el instanceof HTMLElement)) {
return
}
// Get the computed values and assign them back to the style, simplifying
// the CSS that gets handled by HTML2PDF
const styles = window.getComputedStyle(el) const styles = window.getComputedStyle(el)
el.style.setProperty("grid-column-end", styles.gridColumnEnd, "important") el.style.setProperty("grid-column-end", styles.gridColumnEnd, "important")
} }
@ -185,12 +188,4 @@
top: calc(var(--top) + var(--margin)); top: calc(var(--top) + var(--margin));
background: transparent; background: transparent;
} }
/*.divider::after {*/
/* position: absolute;*/
/* top: -32px;*/
/* right: 24px;*/
/* content: var(--idx);*/
/* color: var(--spectrum-global-color-static-gray-400);*/
/* text-align: right;*/
/*}*/
</style> </style>