Shadow DOM is a fairly recent-ish spec that gives you DOM tree encapsulation — it’s one…
In 2017, across both Chrome and Safari (with Edge and Firefox coming soon), you can encapsulate HTML and CSS in a “shadow root”. Shadow DOM allows you to keep this code separate from the rest of your document. 🙅