vuejs/vue-web-component-wrapper

Road to Constructable Stylesheet Objects

oceangravity opened this issue · 2 comments

Hice guys!

There's a plan to apply Constructable Stylesheet Objects (and polyfill) on future?

Maybe here:

class CustomElement extends HTMLElement {

Recently I've created a Vue component with this wrapper, but I implement the Stylesheet adoption on mounted()

this.$el.parentNode.shadowRoot.adoptedStyleSheets = [styleObject]

Thanks!

wbern commented

@oceangravity do you mean that you got it to work with the code snippet mentioned? The shadowroot is to my knowledge not yet available in the mounted hook, so I'm curious how your code would run.

Hi, here is a Vite plugin to use adoptedStyleSheets API with vue https://github.com/lseguin1337/vue-adopted-stylesheets
(PS: it's not directly compatible with this webcomponent wrapper library)