mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
fix text input custom style wiping out base user style (#3031)
This commit is contained in:
parent
f9a970be9b
commit
d2ae0d9ada
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue