The <slot>
tag is very useful when creating custom elements.
However, this feature is only available with the use of shadow dom, the downside being that we can't use the parent document's css to style the shadow dom.
So we either copy the css into the shadow dom or don't use slots at all.
In this snippet we'll see how to circumvent this limitation with the use of a MutationObserver object.