linaria icon indicating copy to clipboard operation
linaria copied to clipboard

How to use Linaria with custom elements and ShadowDOM / ShadowRoots?

Open trusktr opened this issue 6 years ago • 2 comments

First let me say, this is a nice project!

I'd like to make custom elements, and to give their content styling inside ShadowRoots.

I could possibly @import the URL of the output CSS file in every root's <style>, but then this would load all styles of every element in each shadow root.

Another thing is, how can we code the custom elements in a way that they do not know what the output URL is?

What about custom elements that will be published as a package for anyone to use? How would the custom elements know the URL to @import inside their <style> tags?

Any recommendation on how to handle ShadowDOM with Linaria?

trusktr avatar Oct 21 '19 07:10 trusktr

same question. Any updates?

ghost avatar Jul 28 '22 13:07 ghost

Yes, I would like to know as well. You can use custom elements using a stylesheet in styled-components.

Not sure what to do with linaria?

khanakia avatar Apr 11 '23 12:04 khanakia