PlasmoHQ / plasmo

🧩 The Browser Extension Framework
https://www.plasmo.com
MIT License
10.14k stars 350 forks source link

[BUG] about csui style hierarchy #835

Open woftsun opened 9 months ago

woftsun commented 9 months ago

What happened?

image

const getStyle: PlasmoGetStyle = () => {
  const style = document.createElement("style")
  style.textContent = (cssText + antCssText).replaceAll(':root', ':host')
  return style
}

const getInlineAnchor: PlasmoGetInlineAnchor = () =>
    document.querySelector(".ecom-g-layout-sider")

const mountShadowHost: PlasmoMountShadowHost = ({ anchor, shadowHost }) => {
  anchor!.element!.insertBefore(shadowHost!, anchor!.element!.firstChild)
}

I'm going to hang the dom in 1, and when I use the component library, the message component of the component library is at the position of the entire page 2, so I can't override the injected style, so I can choose the mount location of the style

Version

Latest

What OS are you seeing the problem on?

Windows

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

(OPTIONAL) Contribution

Code of Conduct