Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you provide a props to insert class into a specified node?(e.g. use in shadowDOM) #98

Open
GisonL opened this issue Jan 31, 2024 · 0 comments

Comments

@GisonL
Copy link

GisonL commented Jan 31, 2024

  1. Your source code:
    function ___$insertStyle(css) { if (!css || typeof window === 'undefined') { return; } const style = document.createElement('style'); style.setAttribute('type', 'text/css'); style.innerHTML = css; document.head.appendChild(style); return css; }

  2. I want to use in shadowDOM , But i can't use your class. So can you provide a props to insert class to my node, or css file? e.g.
    `import root from "react-shadow/styled-components";
    import tailwindCSS from "@/styles/tailwind.less?inline";

<root.div ref={shadowRef} id="shadowRoot">
<style type="text/css">{tailwindCSS}</style>
{/* ... */}
</root.div>`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant