samrum / vite-plugin-web-extension

A vite plugin for generating cross browser platform, ES module based web extensions.
MIT License
323 stars 33 forks source link

Cannot use MUI in content script because of prefix #123

Closed Honsal closed 1 year ago

Honsal commented 1 year ago

after bundle, in <head>

<head>
/* ... */
<style data-emotion="css" data-s="">
    .css-lcrz3t-MuiTypography-root{margin:0;font-family:Noto Sans KR,sans-serif;font-weight:400;font-size:0.875rem;line-height:1.43;color:white;}
</style>

but in content script rendered component,

<span class="MuiTypography-root MuiTypography-body1 css-rfrue5-MuiTypography-root">Typo</span>

There's no css-lcrz3t- prefix so it could not render properly. How can I solve it? Or have I to wait until update?

Honsal commented 1 year ago

Solved using @emotion/cache, createCache and CacheProvider