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 can I use Shadow DOM content distribution with react-shadow? ( mix light with shadow, use <slot>) #108

Open
tomalec opened this issue May 2, 2021 · 3 comments

Comments

@tomalec
Copy link

tomalec commented May 2, 2021

I would like to use slot element in my shadow root, to distribute some light there.
https://codesandbox.io/s/react-shadow-forked-ecmem?file=/public/index.html:1591-1932

<div class="quote">
  <template shadowroot="open">
    <style>
      q {
        font-family: Times, "Times New Roman", serif;
        font-size: 2em;
      }
    </style>
    <q>There is strong shadow where there is <slot></slot>.</q>
    <slot name="author">unknown</slot>
  </template>
  much light
  <e.Author slot="author">― Johann Wolfgang von Goethe.</e.Author>
</div>

So, far I was able to make everything render in shadow root, but I'd like my component to distribute also light DOM.

How could I add some light content to the shadow host?

@Anifacted
Copy link

@tomalec Did you ever find an answer to this problem? I am in the same situation.

@Dihgg
Copy link

Dihgg commented Jan 5, 2023

I also have similar situation, @tomalec and @Anifacted Did you find an answer? 👀

@xy1041
Copy link

xy1041 commented Jun 15, 2023

so, slot is not supported in react-shadow?

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

No branches or pull requests

4 participants