-
I'm creating a Chrome extension and, to separate the styles of the page I am applying my app as a content script from my styles, I am using an iframe component by using the This way, the only thing I get when I try to use the I know that Is there any possible way I could do this with emotion? Related: #3120 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello @doougui,
This library exposes API to create a cache with which you can configure the insertion point of the generated stylesheets. import createCache from '@emotion/cache';
import { CacheProvider } from '@emotion/react';
import Frame, { useFrame } from 'react-frame-component';
const FrameStyleCache = ({ children }) => {
const { document, window } = useFrame();
const cache = useMemo(() => createCache({
key: 'frame-cache',
container: document.head
}), [ document ]);
return <CacheProvider value={cache}>{children}</CacheProvider>
};
const App = () => {
return <Frame>
<FrameStyleCache>
<Main />
</FrameStyleCache>
</Frame>;
}; Disclaimer: Above code should theoretically word, but is untested. |
Beta Was this translation helpful? Give feedback.
Hello @doougui,
react-select
usesemotion
as a CSS-in-JS styling library.This library exposes API to create a cache with which you can configure the insertion point of the generated stylesheets.