The first is we can use Native CSS encapsulation. Consumers who have an intimate knowledge of the dialog’s inner workings can easily consume and use the dialog by creating their own element and defining the content and styles they wish to use (even relying on global styles defined elsewhere). Some notes though: Totally agree with Mattia: to assign styles directly using JS rather than classes, breaks basically all the possible conventions related to UI development and make it impossible to maintain and reuse the component. Dialog example using shadow root, slots and template by Caleb Williams (@calebdwilliams) Both paragraphs would be red if they did. seems data URIs are restricted to a few things only in IE. It matches elements based on two conditions: That’s a slotted element, that comes from the light DOM. In the demo above, changing the template attribute on our