Improve CSS preprocessing
This commit is contained in:
parent
51ba8510a8
commit
66bff41b31
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue