callstack / callstack/linaria

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

Open
#496 2 comments 3 reactions 0 assignees View on GitHub
needs: investigation 🔎 question ❔
Dominant language
TypeScript
Stars
12.4k
Forks
413
PR merge metrics
No merged PRs in 30d

Description

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 ``, 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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.