- From: Caleb Williams <notifications@github.com>
- Date: Tue, 20 Feb 2018 08:04:09 -0800
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Tuesday, 20 February 2018 16:05:10 UTC
Why would this be blocked per the constructible stylesheet? I think it should definitely plan to incorporate such a feature, but I don't see any reason why we couldn't load in an external stylesheet to be applied or pass in a string for styles. It might not be perfect. Also, I do think that following Angular's pattern of applying styles as an array is preferable. I can foresee some cases where a user might want to set up a single stylesheet to set up CSS variables or `@apply` rules that might be used across multiple components. It would be a big benefit to be able to define that once and reuse across multiple custom elements. Using a syntax similar to what I defined above you could do: ```javascript class MyLibraryComponent extends HTMLElement { constructor() { super(); this.attachShadow({ mode: 'open', styles: [ 'my-library-variables', 'my-library-component' ] }); } } ``` -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/webcomponents/issues/468#issuecomment-367025968
Received on Tuesday, 20 February 2018 16:05:10 UTC