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

How to put styles inside web component? #499

Open
m4rvr opened this issue Nov 2, 2022 · 1 comment
Open

How to put styles inside web component? #499

m4rvr opened this issue Nov 2, 2022 · 1 comment

Comments

@m4rvr
Copy link

m4rvr commented Nov 2, 2022

Hey!

I have a web component and want to add the styled to a <style> tag inside the root of it.

Creating a custom styled with const styled = styled.bind({ target: target }) doesn't work because the target isn't there on the first render of the component hence it falls back to the <head> again.

Any idea what I can do to make this work?

@cristianbote
Copy link
Owner

The target usually is the head element. What are you passing as a target when you're binding? Take a look at this example: https://codesandbox.io/s/immutable-moon-x7k7xwz6mz

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

No branches or pull requests

2 participants