- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 4.7k
 
Labels
Description
Describe the problem
Currently, the only thing you can pass to shadow DOM contructor is either mode: "open" or nothing at all.
https://svelte.dev/docs/svelte/custom-elements#Component-options
This means that you can't create shadow DOM with closed shadow root or change any other options of attachShadow().
Describe the proposed solution
Instead of passing only "none" to the shadow custom element option, allow passing the whole options object, which would be then passed to attachShadow().
This would allow changing shadow root mode to closed and would also allow you to customize all the other options.
This would probably be considered a breaking change for everyone already using shadow: "none", so you should be able to still pass either:
shadow: "none"orshadow: "open"- to maintain backwards compatibility- something like 
shadow: { mode: 'closed', clonable: false }(or any other options) 
Importance
nice to have