Preferences

Yeah, I also used the Shadow DOM a lot working on a CMS that edit the website content “in place”: CMS UI was safely scoped inside my web components thanks to their Shadow roots, I never had to worry about arbitrary styles from the websites the CMS was loaded in colliding with internal CSS.

Shadow DOM exists for some specific use cases but it shouldn’t systematically used when creating web components.


I actually think shadow DOM plus CSS import assertions are an incredibly good combination and make it totally suitable as a sensible default.
I also agree with you, I simply think the need for shadow root depends on the level of encapsulation you need.

This item has no comments currently.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal