ReactShadow icon indicating copy to clipboard operation
ReactShadow copied to clipboard

Shadow tree inheriting from parent

Open rrs94 opened this issue 4 years ago • 2 comments

Hi, I'm trying to test out this library but I'm having issues with getting the expected behavior to work, I modified the example: https://codesandbox.io/s/react-shadow-forked-4717v?file=/src/index.js:454-459

So that the parent of the shadow host has a "color: red" style applied to it, and this style is being inherited by the elements inside the shadow tree even this is not supposed to happen. Am I doing something wrong or perhaps I misunderstood the functionality of shadow dom? Thanks!

rrs94 avatar Oct 28 '21 14:10 rrs94

I'm having the same issue.

Screen-Shot-2022-03-17-at-1 01 42-PM

lancesnider avatar Mar 17 '22 20:03 lancesnider

Okay, found the answer 2 seconds after posting this. :) Here's the relevant thread: https://github.com/Wildhoney/ReactShadow/issues/68

Turns out there are still some styles that bleed through the shadow boundary. I got around this by adding all: initial; to the top-level class.

lancesnider avatar Mar 17 '22 20:03 lancesnider