Re: [WICG/webcomponents] "open-stylable" Shadow Roots (#909)

I really like the idea of an opt-in approach to allowing styles to cascade.  Personally, the encapsulation is a big part of why we wanted to use web components for our design components but I can understand why that's not always the aim.  I like the idea of having at least 2 options:

1. Allow all CSS to penetrate the shadow DOM using an opt-in approach such as
    ```
    this.attachShadow({
      mode: 'open',
      styles: 'all'
    });
    ```
2. Allow only specific stylesheets to penetrate the shadow DOM:
    ```
    this.attachShadow({
      mode: 'open',
      styles: [stylesheetPointer] // array of pointers to specific stylesheets?
    });
    ```

Having a separate property like `styles` that can accept a few different inputs gives us a lot of flexibility to add functionality as we go.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/909#issuecomment-791496926

Received on Friday, 5 March 2021 15:38:44 UTC