praveenpuglia / shadow-dom-in-depth

Everything you need to know about Shadow DOM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can global css be applied to shadow dom elements?

alexvbush opened this issue · comments

Thank you for putting such a great TLDR! I've been scouring the web but I can't find any good explanations on how to share css styles between larger DOM or from parent shadow dom element to child. i.e. how can I use say tailwind or material css library and use it in all of my shadow dom elements without any performance hits or "flickering"?

Thank you for your reply in advance!

Do you mean applying, let's say classes, to shadow dom elements in order to get the same styles? or something like that? For that, the component author need to provide you with a way to pass on the classes.

In general, if they keep the components as simple as possible, you should just be able to apply your classes / styles to your custom element and those will be received by the root element.

Also can you show a demo where you experimented with some ideas and hit perf issues?

P.S - It's been a really long time I worked on any of the WC stuff so I might sound totally drunk.