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

<slot> #8

Open
4 tasks
DrSensor opened this issue Sep 8, 2022 · 0 comments
Open
4 tasks

<slot> #8

DrSensor opened this issue Sep 8, 2022 · 0 comments
Labels
enhancement New feature or request priority: high Although it's not part of the milestone, it's urgent and must be resolved

Comments

@DrSensor
Copy link
Owner

DrSensor commented Sep 8, 2022

  • replace all elements that has slot or slot: attributes into <slot> or <slot name="⟒"> when moved into shadow root while the elements still inside the top level host Element (a.k.a light DOM).
  • make all children in <template> inherit all of it's attributes. This mean all children will inherit the slot attribute of <template slot="⟒" slot:="…"> when moved into light DOM. Note that <template> are not moved into shadow DOM while all of it's children stay in the host Element without being wrapped by <template>…</template>.

To guarantee and not break the dom isolation, the implementation might involve one or many of this features:


<slot> is a native WebComponent feature. The usual usage is like a portal but I'm thinking it's worth more. For example, it can be used as a way to inject an island component from other framework. Another way is for conditional and list rendering. So this is more about documenting on how to use <slot> in that scenario. There is no need to implement <slot> from scratch or made custom functionality for certain use cases:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: high Although it's not part of the milestone, it's urgent and must be resolved
Projects
None yet
Development

No branches or pull requests

1 participant