News for hackers. Stuff that matters.
Re:My HTML Web Component boilerplate for 2026 by jetin on Wednesday December 24, 2025 @02:55PM (#46378659)
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.

Re:My HTML Web Component boilerplate for 2026 by mdhb on Wednesday December 24, 2025 @02:59PM (#46378692)
I actually think shadow DOM plus CSS import assertions are an incredibly good combination and make it totally suitable as a sensible default.
Re:My HTML Web Component boilerplate for 2026 by jetin on Thursday December 25, 2025 @01:01AM (#46382473)
I also agree with you, I simply think the need for shadow root depends on the level of encapsulation you need.