3 ms·
I don't understand why people use the shadow Dom. Why not edit the Dom directly?
by toasted-subs 3y ago
I don't understand why people use the shadow Dom. Why not edit the Dom directly?
- lpedrosa 3y agoYou are correct. You don't have to use the shadow DOM, when you create a new Custom Element. The shadow DOM provides two things: - style encapsulation (as well as `id` attributes) - ability to use `<slot>` for templating You should use it if you require one of the above or both.