Skip to content

Commit

Permalink
supplemental documentation for Shadow DOM and slot usage
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 committed Dec 30, 2020
1 parent 6e04044 commit 9b055a3
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion www/pages/docs/component-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,19 @@ customElements.define('x-greeting', GreetingComponent);

## References
- [MDN Developer Docs: Web Components](https://developer.mozilla.org/en-US/docs/Web/Web_Components)
- [Google Developer Docs: Web Components](https://developers.google.com/web/fundamentals/web-components/)
- [Google Developer Docs: Web Components](https://developers.google.com/web/fundamentals/web-components/)


> Some notes / recommendations about ShadowDOM from [our research](https://github.com/ProjectEvergreen/greenwood/pull/454)
> - [`<slot>` should be named](https://github.com/Polymer/lit-element/issues/824#issuecomment-535574662)
> - `<slot>` only supports a [shallow (one) level of nesting](https://javascript.info/slots-composition). A `<slot>` tag must be within a direct descendant of its `:host`.
> ```html
> <h3>Content from inside the custom element. (inside HTMLElement)</h3>
> <h3>
> <slot name="content"></slot> <!-- will show -->
> <h3>
> <div>
> <h3>
> <slot name="content"></slot> <!-- wont show -->
> <h3>
> </div>

0 comments on commit 9b055a3

Please sign in to comment.