fix: Reset fontsize when the fontsize of the html element is changed. (#348)

This commit is contained in:
Gabe
2025-11-02 23:37:04 +08:00
parent 61a4a8f920
commit fd91bcf603
3 changed files with 17 additions and 41 deletions

View File

@@ -92,22 +92,18 @@ export default class ShadowDomManager {
if (this._className) {
host.className = this._className;
}
host.style.display = "none";
document.body.parentElement.appendChild(host);
this.#hostElement = host;
const shadowContainer = host.attachShadow({ mode: "closed" });
const emotionRoot = document.createElement("style");
document.body.appendChild(host);
this.#hostElement = host;
const shadowContainer = host.attachShadow({ mode: "open" });
const appRoot = document.createElement("div");
appRoot.className = `${this._id}_wrapper`;
shadowContainer.appendChild(emotionRoot);
shadowContainer.appendChild(appRoot);
const cache = createCache({
key: this._id,
prepend: true,
container: emotionRoot,
container: shadowContainer,
});
const enhancedProps = {