support css variables in sanitize

This commit is contained in:
Kendall Garner 2025-02-27 16:42:02 -08:00
parent e57232f89c
commit ef194424e3
No known key found for this signature in database
GPG key ID: 18D2767419676C87

View file

@ -23,6 +23,9 @@ const addStyles = (output: string[], styles: CSSStyleDeclaration) => {
} else if (typeof value === 'number') {
output.push(`${key}:${value}${priorityString};`);
}
} else if (styles.getPropertyValue(key)) {
// These will not override the value unless not declared !important
output.push(`${key}: ${styles.getPropertyValue(key)} !important;`);
}
}
};