fix text input custom style wiping out base user style (#3031)

This commit is contained in:
Kieran Black 2024-02-26 00:07:45 -06:00 committed by GitHub
parent f9a970be9b
commit d2ae0d9ada
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -29,6 +29,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
async function setStyling(property: string, value: unknown): Promise<void> {
const rule = await userBaseRule;
rule.style[property] = value;
// if we don't set the textContent of the underlying HTMLStyleElement, addons
// which extend the custom style and set textContent of their registered tags
// will cause the userBase style tag here to be ignored
const baseStyle = await userBaseStyle;
baseStyle.element.textContent = rule.cssText;
}
$: setStyling("color", color);