Is there any way to use emotion's cache outside React?September 2, 2019 at 10:38pm
I'm working on svelte-based project and I want to use shadow DOM for style encapsulation (chrome extension). Therefore I've attached <style> tag to my app node root (e.g. <div id="app"></div>). In result I have <style> tag inside aforementioned div (which is correct), but I would want to make emotion appends generated classes to this style tag instead of adding them to automatically generated <style> in document <head>.
In React there is possibility to use "createCache" which has "container" option - "A DOM node that emotion will insert all of its style tags into. This is useful for inserting styles into iframes."