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 20760f6dc9
commit f7548cdf16

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);